Skip to content

"Rename" of a static interface member at consumption site doesn't rename related implicit/explicit implementations. Produces code with errors. #54029

@AlekseyTs

Description

@AlekseyTs
interface I1
{
    static abstract void M1();
}

class C1_1 : I1
{
    // Implicit implementation
    public static void M1() { }    
}

class C1_2 : I1
{
    // Explicit implementation
    static void I1.M1() { }
}

interface I2
{
    abstract static int P2 { get; set; }
}

class C2_1 : I2
{
    // Implicit implementation
    public static int P2 { get; set; }
}

class C2_2 : I2
{
    // Explicit implementation
    static int I2.P2 { get; set; }
}

interface I3
{
    abstract static event System.Action E3;
}

class C3_1 : I3
{
    // Implicit implementation
    public static event System.Action E3;
}

class C3_2 : I3
{
    // Explicit implementation
    static event System.Action I3.E3
    {
        add { }
        remove { }
    }
}

class Consumer
{
    void Method<T>() where T: I1
    {
        T.M1();
    }

    int Property<T>() where T : I2
    {
        T.P2 = 2;
        return T.P2;
    }

    void Event<T>(System.Action d) where T : I3
    {
        T.E3 += d;
        T.E3 -= d;
    }
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions