-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hande error scenarios involving target types and named arguments in nullable walker #72635
Hande error scenarios involving target types and named arguments in nullable walker #72635
Conversation
parameter is null || | ||
// In error recovery with named arguments, target-typing cannot work as we can get a different parameter type | ||
// from our GetCorrespondingParameter logic than Binder.BuildArgumentsForErrorRecovery does. | ||
node is BoundCall { HasErrors: true, ArgumentNamesOpt.IsDefaultOrEmpty: false, ArgsToParamsOpt.IsDefault: true }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain why we want ArgsToParamsOpt to be default in order to enter this path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's not default it means we know the args-to-params mapping so we can continue. The problem is only in error scenarios where the bad BoundCall does not contain the mapping even though there are named arguments in the call. That's when we want to enter this path to skip further processing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to merge before the snap. Will follow up if you have more comments. Thanks.
Fixes #72541.