Skip to content

Fix nullable analysis of lambdas within conditional expressions#47405

Merged
RikkiGibson merged 4 commits intodotnet:masterfrom
RikkiGibson:fix-40561
Sep 9, 2020
Merged

Fix nullable analysis of lambdas within conditional expressions#47405
RikkiGibson merged 4 commits intodotnet:masterfrom
RikkiGibson:fix-40561

Conversation

@RikkiGibson
Copy link
Member

Fixes #40561

For reasons I don't fully understand, analysis of conditional expressions is broken apart into phases, which can be seen in the implementation of VisitConditionalOperatorCore. It seems like the convertResult calls at the end can end up visiting the lambda over again, and when we do this without threading in the appropriate state, we can get spurious warnings.

Please review @333fred @dotnet/roslyn-compiler.

@RikkiGibson RikkiGibson merged commit 7b7c5ef into dotnet:master Sep 9, 2020
@ghost ghost added this to the Next milestone Sep 9, 2020
@RikkiGibson RikkiGibson deleted the fix-40561 branch September 9, 2020 13:29
@dibarbet dibarbet modified the milestones: Next, 16.8.P4 Sep 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect CS8604 with captured variable in ternary operator

4 participants