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

NullableWalker.Scan().getFieldSymbolToBeInitialized(): Is checking IsAutoProperty sufficient or should we check the appropriate accessors are missing or auto-implemented #75245

Open
RikkiGibson opened this issue Sep 25, 2024 · 0 comments · May be fixed by #75872

Comments

@RikkiGibson
Copy link
Contributor

RikkiGibson commented Sep 25, 2024

          I will try and resolve this comment in my upcoming PR. I think we should just check for a `BackingField` and return it here.

Originally posted by @RikkiGibson in #75116 (comment)

Code being referenced:

static Symbol getFieldSymbolToBeInitialized(Symbol requiredMember)
=> requiredMember is SourcePropertySymbol { IsAutoProperty: true } prop ? prop.BackingField : requiredMember;

It feels like this is another piece of our attempts to correctly substitute the field for the property and vice-versa when initializing/reading/managing flow state, and this check/branch can probably be consolidated into another area. But it doesn't appear to be urgent or impacting correctness.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Sep 25, 2024
@jaredpar jaredpar added New Feature - Field Keyword and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Oct 1, 2024
@jaredpar jaredpar added this to the 17.13 milestone Oct 1, 2024
@arunchndr arunchndr modified the milestones: 17.13, 17.13 P2 Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants