-
Notifications
You must be signed in to change notification settings - Fork 86
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
C# 7.x: Allow field-targeted attributes on auto-property declarations #262
Conversation
converting to draft: C# 7.x feature |
64caca6
to
adcb5cf
Compare
3964d86
to
2c551e4
Compare
I'll fix up the example - possibly replacing the attribute with a different one, to avoid any interpretation that this feature is linked to serialization. |
Okay, having changed the attribute in question, I'm personally happy with this - if others are happy, we can merge it tomorrow. |
0e70b82
to
a14d97c
Compare
This needs changes in §21.3 Attribute specification as well. Change to allow csharpstandard/standard/attributes.md Line 278 in a14d97c
Change to list csharpstandard/standard/attributes.md Line 286 in a14d97c
|
Done in another commit. I've currently kept the singular form in the first part of the description, for consistency with the rest, but I'm tempted to change it to "Field-like events and automatically implemented properties can ..." |
da63466
to
ab777da
Compare
Shall the compiler issue a warning here? using System;
class C {
C() { P = 1; }
[field: Obsolete]
int P { get; }
} csharpstandard/standard/classes.md Line 3381 in ab777da
csharpstandard/standard/attributes.md Line 770 in ab777da
|
…eted (This assumes dotnet#262 is merged later.)
Could perhaps add to §14.7.4
or to §21.5.4
|
I'm not sure that's necessary, as I'd personally argue that the property (which is the member being used) effectively isn't decorated with the |
Whoops - I understand your point now, about that specific case referring to the field. Given the latter part, the group has decided that we'll merge this PR, and raise a new issue about it to fix for both. (The reverse case is interesting too, where the property is obsolete but the field isn't.) Intuition from Mads: the code effectively refers to the property, and the fact that it refers to a field is "sort of" an implementation detail - so it may be that we tweak 14.7.4 a little. But we'll deal with it in the new issue (which I'll link to this one). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🐸
…eted (This assumes #262 is merged later.)
@KalleOlaviNiemitalo: On a separate note, thank you for everything you've been spotting in this PR and others. We really appreciate it. |
Note that v6 PR #11 modifies much of 15.7.4, and in this new PR, we’re adding new text at the end of that section, which should not overlap with the v6 mods, which had not yet been merged when this new PR was created.