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

Record property fails to override inherited abstract property #44618

Closed
gafter opened this issue May 28, 2020 · 0 comments · Fixed by #45336
Closed

Record property fails to override inherited abstract property #44618

gafter opened this issue May 28, 2020 · 0 comments · Fixed by #45336

Comments

@gafter
Copy link
Member

gafter commented May 28, 2020

The spec in dotnet/csharplang#3505 says

For each record parameter of a record type declaration there is a corresponding public property member whose name and type are taken from the value parameter declaration. If no concrete (i.e. non-abstract) property with a get accessor and with this name and type is explicitly declared or inherited, it is produced by the compiler as follows:

For a record struct or a record class:

  • A public get and init auto-property is created (see separate init accessor specification). Its value is initialized during construction with the value of the corresponding primary constructor parameter. Each "matching" inherited abstract property's get accessor is overridden.

(Emphasis mine)

However, the test Inheritance_07 in #44595 demonstrates that the implementation does not obey the specification.

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.

3 participants