-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Questions for semi-auto properties #61019
Comments
https://github.com/dotnet/csharplang/blob/main/proposals/semi-auto-properties.md + An automatically implemented property (or ***auto-property*** for short), is a non-abstract non-extern
+ property with either or both of:
+ 1. an accessor with a semicolon-only body
+ 2. usage of the `field` contextual keyword ([Keywords](lexical-structure.md#keywords)) within the accessors or
+ expression body of the property. The `field` identifier is only considered the `field` keyword when there is
+ no existing symbol named `field` in scope at that location.
Auto-implemented properties must override all accessors of the overridden property |
Closing. Will open this as multiple issues, each is focused on a single scenario. |
@AlekseyTs Should I open in csharplang or here? |
@333fred Do you have any preference? I don't. |
Prefer opening questions for LDM in csharplang. |
I'm not sure if they need to be discussed in LDM or the answer is simply clear. But let me open it there. |
Moving discussion from #57012 (comment).
Comment by @Youssef1313:
There are interesting scenarios around overriding virtual properties.
Do these scenarios have clear answer as to what's the expected behavior? Are there any that needs to be discussed in LDM?
cc @AlekseyTs @333fred @CyrusNajmabadi
Comment by @AlekseyTs:
Could you add a quote from the relevant portion of the spec?
Please include exact wording of the message.
We probably should treat this as a property with a user provided body. Presence of the
field
keyword probably shouldn't make any difference.The text was updated successfully, but these errors were encountered: