Skip to content

Correctly handle lambda expressions in the nullable walker when they are passed as arguments to a bad expression#51644

Merged
333fred merged 2 commits intodotnet:mainfrom
333fred:bad-lambda-args
Mar 9, 2021
Merged

Correctly handle lambda expressions in the nullable walker when they are passed as arguments to a bad expression#51644
333fred merged 2 commits intodotnet:mainfrom
333fred:bad-lambda-args

Conversation

@333fred
Copy link
Member

@333fred 333fred commented Mar 3, 2021

We weren't handling this case correctly, when a lambda appears as a direct argument to a bad expression such as a bad constructor call. We have similar issues for initializers documented at #35042, but those are both more complicated to solve and easier to work around in the verifier, so I took the option of actually fixing the bug. This will cause us to report new warnings for bad code: the warnings in Lambda_21 and Lambda_22 were not present prior to this change because we skipped visiting the lambda body entirely. As it's always invalid code, this should be fine.

Fixes #51461. @dotnet/roslyn-compiler @RikkiGibson for review.

…are passed as arguments to a bad expression.
@333fred 333fred requested review from a team and RikkiGibson March 3, 2021 23:23
@ghost ghost added the Area-Compilers label Mar 3, 2021
Base automatically changed from master to main March 3, 2021 23:53
@333fred
Copy link
Member Author

333fred commented Mar 4, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

@jaredpar
Copy link
Member

jaredpar commented Mar 4, 2021

Doing a close / open to test a theory about our CI

@jaredpar jaredpar closed this Mar 4, 2021
@jaredpar jaredpar reopened this Mar 4, 2021
@RikkiGibson RikkiGibson self-assigned this Mar 4, 2021
@333fred
Copy link
Member Author

333fred commented Mar 5, 2021

@dotnet/roslyn-compiler for a second review.

@333fred
Copy link
Member Author

333fred commented Mar 8, 2021

@dotnet/roslyn-compiler for a second review please.

@jcouv jcouv self-assigned this Mar 9, 2021
Copy link
Member

@jcouv jcouv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM Thanks (iteration 2)

@jcouv jcouv added this to the 16.10 milestone Mar 9, 2021
@333fred 333fred merged commit 3c450a1 into dotnet:main Mar 9, 2021
@333fred 333fred deleted the bad-lambda-args branch March 9, 2021 18:36
@allisonchou allisonchou modified the milestones: 16.10, Next Mar 12, 2021
@allisonchou allisonchou modified the milestones: Next, 16.10.P2 Mar 29, 2021
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.

Hit nullability assert compiling roslyn with roslyn.

5 participants