Skip to content

Records: Should produce an error when member we pick as positional member is hidden  #52630

@jcouv

Description

@jcouv

In the following example, we use Base.I as the positional member (ie. it is used as part of C.Deconstruct synthesized method). But it is hidden by the method C.I.
From discussion in LDM 4/14/2021, we decided to make this an error and take this as a breaking change for 16.10.

public record Base
{
    public int I { get; set; } = 42;
    public Base(int ignored) { }
}
public record C(int I) : Base(I)
{
    public void I() { } // hiding
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions