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

Draft: Overloading result-based pruning shouldn't prefer inapplicable alt #21730

Closed
wants to merge 1 commit into from

Conversation

smarter
Copy link
Member

@smarter smarter commented Oct 9, 2024

If an overloaded alternative in alts does not end up being part of the candidate list in resolveOverloaded1, then it is not applicable to the current arguments and should not be considered by adaptByResult. This avoids discarding working solutions in favor of invalid ones when the working solution involves a match type in the method result type that will fail resultConforms.

Fixes #21410.

… alt

If an overloaded alternative in `alts` does not end up being part of the
`candidate` list in `resolveOverloaded1`, then it is not applicable to the
current arguments and should not be considered by `adaptByResult`. This avoids
discarding working solutions in favor of invalid ones when the working solution
involves a match type in the method result type that will fail `resultConforms`.

Fixes scala#21410.
@smarter smarter closed this Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Overloading resolution incorrectly drops alternative with match type result when a target type is provided
1 participant