Support field references in speculative SemanticModel for property accessors, including for auto-properties and partial properties.
This may require public API support to indicate that a statement or expression should be parsed in the context of an accessor, so that field is treated as keyword.
See related tests PropertyFieldKeywordTests.SpeculativeSemanticModel_* in earlier feature branch features/semi-auto-props.
Note: i would not expect field in a spec semantic model to bind to anything, if the initial semantic model didn't have field in the prop. But i also would expect it to not crash.
Support
field
references in speculativeSemanticModel
for property accessors, including for auto-properties and partial properties.This may require public API support to indicate that a statement or expression should be parsed in the context of an accessor, so that
field
is treated as keyword.See related tests
PropertyFieldKeywordTests.SpeculativeSemanticModel_*
in earlier feature branchfeatures/semi-auto-props
.See also https://github.com/dotnet/roslyn/pull/75904#discussion_r1841648406.