Open otac0n opened 11 months ago
These are all bad suggestions.
x = x.word
is a perfectly valid expression to be passed as an argument if x
is an identifier.
Yes, I'm aware. But in the case that this is a raised semantic error, I would prefer the message to be improved.
Analyzer
Diagnostic ID: CS0103
Describe the improvement
=>
is available (e.g. replace x = x.foo with x => x.foo) (for one case but maybe more, with wider closure exceptions)Describe suggestions on how to achieve the rule
As above, replace the syntax tree. If the parse is better (according to constrained analysis), update the existing diagnostic.
Additional context
.Select(x => x.word)
vs
.Select(x = x.word)