Skip to content

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