Skip to content

"Implement interface explicitly" fixer implements conversion operators implicitly  #61263

@AlekseyTs

Description

@AlekseyTs
interface I11<T11> where T11 : I11<T11>
{
    static abstract implicit operator long(T11 x);
    static abstract explicit operator int(T11 x);
}

class C11 : I11<C11>
{
}

Use "Implement interface" fixer for C11 with implement explicitly option.
Observed operators are implemented implicitly:

class C11 : I11<C11>
{
    public static implicit operator long(C11 x)
    {
        throw new NotImplementedException();
    }

    public static explicit operator int(C11 x)
    {
        throw new NotImplementedException();
    }
}

Expected explicit implementation:

class C11 : I11<C11>
{
    static implicit I11<C11>.operator long(C11 x)
    {
        throw new NotImplementedException();
    }

    static explicit I11<C11>.operator int(C11 x)
    {
        throw new NotImplementedException();
    }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions