-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Propagate marked attributes from primary constructor parameters to backing fields. #76475
Propagate marked attributes from primary constructor parameters to backing fields. #76475
Conversation
…cking fields. Related to dotnet#73920.
@dotnet/roslyn-compiler Please review |
@dotnet/roslyn-compiler Please review |
|
||
string source2 = @" | ||
public record " + keyword + @" Test1( | ||
[Preserve1] |
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.
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.
#73920 explicitly asks to not copy the attribute for records:
Cases where attributes should not flow:
- Primary constructor parameters of record types: the compiler allows adding [property: ...] annotations to primary constructor parameters of record types ...
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.
A user is able to explicitly apply attributes to backing fields in records
@dotnet/roslyn-compiler For the second review |
@dotnet/roslyn-compiler For the second review |
cf5eed2
into
dotnet:features/GeneratedCodeAttributes
…cking fields. (dotnet#76475) Related to dotnet#73920.
Related to #73920.