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 Mar 9, 2021
Merged
Conversation
…are passed as arguments to a bad expression.
Member
Author
|
/azp run |
|
Azure Pipelines could not run because the pipeline triggers exclude this branch/path. |
Member
|
Doing a close / open to test a theory about our CI |
RikkiGibson
approved these changes
Mar 4, 2021
Member
Author
|
@dotnet/roslyn-compiler for a second review. |
Member
Author
|
@dotnet/roslyn-compiler for a second review please. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_21andLambda_22were 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.