-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[release/9.0] Update field
references in property accessors
#108222
Conversation
Tagging subscribers to this area: @dotnet/area-meta |
@MichalStrehovsky @cston is this ready for review and inclusion in 9.0 release? Does this backport include all changes made in main, in #108219? Source-build is failing (in stage 2) with the following errors - are all of those fixed with these pending changes: dotnet/source-build#4639
|
This change should include all the changes from #108219, and it looks like the errors above should be fixed with these changes. Note, there were some additional errors in main that were not fixed in #108219, but do not appear in the errors above: see follow-up PRs #108225, #108413. |
@cston, @stephentoub who owns this backport? This is blocking source-build stage 2 builds and is needed for 9.0 release. |
@cston will be updating it with the additional PRs / commits from main. |
* Update field references in property accessors * Update field references * Use @ * Rename field --------- Co-authored-by: Stephen Toub <[email protected]>
Backport of #108219, #108225, and #108413 to release/9.0
Rename or qualify
field
references in property accessors to avoid conflict withfield
keyword in C# compiler preview.With the .NET 9 C# compiler, when compiling with
-langversion:preview
,field
references within property accessors are treated as referring to a synthesized backing field for the property rather than to another symbol namedfield
that may be in scope.The change here is to rename existing fields and locals to retain the original intent.
/cc @stephentoub @cston
Customer Impact
The issue was found by compiling dotnet/runtime with the updated .NET 9 C# compiler.
No expected customer impact.
Regression
[If yes, specify when the regression was introduced. Provide the PR or commit if known.]
Testing
[How was the fix verified? How was the issue missed previously? What tests were added?]
Risk
Low risk. The change is a rename of locals and fields only.
IMPORTANT: If this backport is for a servicing release, please verify that:
The PR target branch is
release/X.0-staging
, notrelease/X.0
.If the change touches code that ships in a NuGet package, you have added the necessary package authoring and gotten it explicitly reviewed.