Skip to content
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

Merged
merged 4 commits into from
Mar 25, 2024

Conversation

jjonescz
Copy link
Contributor

@jjonescz jjonescz commented Mar 21, 2024

Fixes #72541.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Mar 21, 2024
@jjonescz jjonescz marked this pull request as ready for review March 22, 2024 10:55
@jjonescz jjonescz requested a review from a team as a code owner March 22, 2024 10:55
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 })
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

@jjonescz jjonescz merged commit ea0acb2 into dotnet:main Mar 25, 2024
24 checks passed
@jjonescz jjonescz deleted the 72541-NRE-ClassifyConversion-dev branch March 25, 2024 18:29
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Mar 25, 2024
@RikkiGibson RikkiGibson modified the milestones: Next, 17.10 P3 Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers New Language Feature - Nullable Reference Types Nullable Reference Types untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NRE in ConversionsBase.ClassifyImplicitConversionFromType
4 participants