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

Prioritize ambiguous errors in extension method search #13588

Merged
merged 1 commit into from
Sep 29, 2021

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Sep 22, 2021

When an extension method search fails with an ambiguity, report the ambiguous message instead
of a message pertaining to the (arbitrary) surviving alternative.

Fixes #13558

When an extension method search fails with an ambiguity, report the ambiguous message instead
of a message pertaining to the (arbitrary) surviving alternative.
@odersky odersky linked an issue Sep 22, 2021 that may be closed by this pull request
| value id is not a member of testcode.A.
| An extension method was tried, but could not be fully constructed:
|
| testcode.ExtensionA.id(a) failed with
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It would be nice if we issued

     id(a)     failed with

instead, but it turns out to be devilishly complicated to do so. So I decided it's not worth going down that rabbit hole since a fix would likely make code that's already super complicated even less understandable.

@anatoliykmetyuk anatoliykmetyuk merged commit 0bece40 into scala:master Sep 29, 2021
@anatoliykmetyuk anatoliykmetyuk deleted the fix-13558 branch September 29, 2021 10:58
@Kordyjan Kordyjan added this to the 3.1.1 milestone Aug 2, 2023
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.

Compiler error caused by import of unrelated extension
3 participants