roslyn icon indicating copy to clipboard operation
roslyn copied to clipboard

Make synthesized primary constructor baking field return the original parameter as an associated symbol

Open DoctorKrolic opened this issue 5 months ago • 5 comments

Closes: https://github.com/dotnet/roslyn/issues/70208

DoctorKrolic avatar Jun 15 '25 15:06 DoctorKrolic

@dotnet/roslyn-compiler for a second review

333fred avatar Jun 16 '25 21:06 333fred

@tmat Please review from EnC perspective

AlekseyTs avatar Jun 17 '25 11:06 AlekseyTs

@CyrusNajmabadi Please review from IDE and Analyzers perspective (all affected places are properly adjusted, etc.)

AlekseyTs avatar Jun 17 '25 11:06 AlekseyTs

There are about 30 use sites for FieldSymbol.AssociatedSymbol, I think they should be explicitly examined, and each should either be adjusted, or an explanation should be provided why the current code is good. Targeted tests for the use sites are also needed, when possible. For each use-site, I suggest either making an appropriate code change (when necessary), or adding an appropriate assert and a comment explaining why the code is fine for the new API behavior. This way reviewers will be able to review actions taken for each use site. Feel free to use other ways to present information about the call sites. Then, we should "pull on the thread" and Identify what other APIs change behavior (for example IFieldSymbolInternal.AssociatedSymbol), and perform the same for them. And continue the cycle until all affected APIs are covered.

To clarify, I would ignore use-sites in tests.

AlekseyTs avatar Jun 17 '25 12:06 AlekseyTs

Done with review pass (commit 3)

AlekseyTs avatar Jun 17 '25 12:06 AlekseyTs