Skip to content

Investigate trimming of static interface methods when the interface is not used #2733

@vitek-karas

Description

@vitek-karas

Currently linker will keep the interface if there's a method which implements one of the static interface methods on it and that implementation method is kept. This is unlike non-static interface methods where the same situation still allows the linker to remove the interface.

Sample:

void Main()
{
    TestClass.Method (); // Use the implementation method only
}

[Kept] // ??? Why
interface IStaticIFace
{
    [Kept] // ??? Why
    static abstract Method();
}

[Kept] // This is correct
class TestClass : IStaticIFace
{
    [Kept] // This is correct
    public static abstract Method() {};
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions