You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Local functions are also not understood. Replacing the Test property in the full repro above:
publicintTest{
get
{
LocalFunction();return42;voidLocalFunction()=> Console.WriteLine(SomeProperty);}}
Although, here's a case where the warning would be desirable:
publicstring?Test{
get
{return LocalFunction();string?LocalFunction()=> SomeProperty;}}
So maybe heuristically ignore lambdas (less likely for a lambda created in a getter to also be invoked by the getter to obtain the return value) and leave local functions as-is until there is a motivation to do something more?
This hits a common pattern (also when not using
??=
):Full repro (using v3.2.3):
The text was updated successfully, but these errors were encountered: