Skip to content

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

@RikkiGibson

Description

@RikkiGibson
          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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions