Skip to content

GenAPI expands interface heirarchy #32195

Open
@ericstj

Description

@ericstj

Describe the bug

When running GenAPI against a type that implements an interface with an inheritance chain every interface in the chain is listed.

To Reproduce

namespace n;
public interface I1 {}
public interface I2 : I1 {}
public interface I3 : I2 {}
public class C : I3 {}

Compile this and point GenAPI to it.

Expect : C to be emitted implementing only I3.

Actual:

namespace n
{
    public partial class C : I3, I2, I1
    {
        public C() { }
    }

    public partial interface I1
    {
    }

    public partial interface I2 : I1
    {
    }

    public partial interface I3 : I2, I1
    {
    }
}

Related: #32165

This is another case where the metadata is ambiguous. We could examine the list of interfaces and reduce it if we wanted brevity.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions