Skip to content

Conversation

@odersky
Copy link
Contributor

@odersky odersky commented Nov 20, 2025

Ignore selection prototypes at first when typing type applications. If we need them later for overloading disambiguation, reveal the ignored type.

The reason for doing this is that a selection might come from an extension method, and in this case we should not require the selected name as a member of the result.

This change breaks one test (overloading-specifity-2.scala) that explicitly tested that we don't consult implicit arguments for disambiguation since the expected type was a selection that already determined the outcome. This logic no longer holds. We have to see whether this change breaks any code in practice.

Fixes #23773

Ignore selection prototypes at first when typing type applications.
If we need them later for overloading disambiguation, reveal the ignored
type.

The reason for doing this is that a selection might come from an extension method,
and in this case we should not require the selected name as a member of the result.

This change breaks one test (overloading-specifity-2.scala) that explicitly
tested that we don't consult implicit arguments for disambiguation since the
expected type was a selection that already determined the outcome. This is logic
no longer holds. We have to see whether this change breaks any code in practice.

Fixes scala#23773
@odersky odersky requested a review from hamzaremmal November 20, 2025 12:17
@odersky
Copy link
Contributor Author

odersky commented Nov 20, 2025

@hamzaremmal I am surprised to not see community build tasks in the task list. Where are they?

@hamzaremmal
Copy link
Member

They are there, they just kick in later.

@hamzaremmal
Copy link
Member

@WojciechMazur can we have an Open CB run on this PR? Thanks.

@hamzaremmal hamzaremmal added the backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it. label Nov 20, 2025
@WojciechMazur
Copy link
Contributor

Sure, I'll schedule the build as soon as I'll fix some infra problems

@odersky
Copy link
Contributor Author

odersky commented Nov 20, 2025

This should be backported to 3.8.0 if it works but not to 3.3 since it involves a change in behavior.

@hamzaremmal
Copy link
Member

hamzaremmal commented Nov 20, 2025

This should be backported to 3.8.0 if it works but not to 3.3 since it involves a change in behavior.

Yes, the label is for 3.8.0, not 3.3.x

Copy link
Member

@hamzaremmal hamzaremmal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but I'll wait for the Open CB run result before approving.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Overload resolution fails to disambiguate between the alternatives

3 participants