Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jcouv opened this issue Apr 14, 2021 · 0 comments · Fixed by #52660
Closed

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

jcouv opened this issue Apr 14, 2021 · 0 comments · Fixed by #52660

Comments

@jcouv
Copy link
Member

jcouv commented Apr 14, 2021

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
}
@jcouv jcouv added this to the 16.10 milestone Apr 14, 2021
@jcouv jcouv self-assigned this Apr 14, 2021
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Issues and PRs which have not yet been triaged by a lead label Apr 14, 2021
@jcouv jcouv removed the untriaged Issues and PRs which have not yet been triaged by a lead label Apr 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant