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

Update field references in property accessors #108219

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

cston
Copy link
Member

@cston cston commented Sep 24, 2024

Rename or qualify field references in property accessors to avoid conflict with field keyword in C# compiler preview.

@cston
Copy link
Member Author

cston commented Sep 24, 2024

cc @jaredpar, @stephentoub

@jaredpar
Copy link
Member

@stephentoub the current plan is that field will be under langversion preview at .NET 9 RTM. These projects build with langversion preview and hence will hit the new behavior during source build.

Think there are a couple of options for how we could deal with this:

  1. Take this PR and then back port to the rel/net9.0 branches
  2. Flip these projects to <LangVersion>latest</LangVersion> in the rel/net9.0 branches
  3. Patch source build.

@stephentoub
Copy link
Member

Think there are a couple of options for how we could deal with this

I'd like to do (1), and only fall back to one of the others if we struggle to get the backport in. We should merge this PR, regardless, as it's the path forward and what we'd want for 10.

@stephentoub
Copy link
Member

@cston, @jaredpar, I assume we've validated this is the complete change necessary for release/9.0 to successfully build with the new compiler bits?

@stephentoub
Copy link
Member

/backport to release/9.0

Copy link
Contributor

Started backporting to release/9.0: https://github.com/dotnet/runtime/actions/runs/11025343810

@cston
Copy link
Member Author

cston commented Sep 25, 2024

I assume we've validated this is the complete change necessary for release/9.0 to successfully build with the new compiler bits?

Unfortunately, there is at least one more use of field within an accessor here. (I'm not sure how I missed that case when I built earlier.)

To find any remaining cases, I may need to create a PR that references the updated compiler nupkg and rely on the build from dotnet/runtime CI.

@cston
Copy link
Member Author

cston commented Sep 25, 2024

Unfortunately, there is at least one more use of field within an accessor here.

Updated in #108225.

When we have an updated compiler package, I'll reference the compiler nupkg in #108225 to catch any additional compile errors in CI.

@cston cston deleted the field-keyword branch September 27, 2024 19:53
@cston cston restored the field-keyword branch September 27, 2024 19:54
sirntar pushed a commit to sirntar/runtime that referenced this pull request Sep 30, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Oct 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants