Skip to content

Hande clashes between same-named exports #14967

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

Merged
merged 5 commits into from
Apr 22, 2022
Merged

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Apr 18, 2022

Fixes #14966

Two parts

  1. Better error message for "clashes after erasure message". We now print the original types of the clashing definitions as well as their common erased type.
  2. In most cases heal the clash between two export forwarders by picking the one which is better according to overloading resolution.

odersky added 2 commits April 18, 2022 21:45
Is this a stability problem? It seems the CI visits Seq definitions in different order than local.
Avoid export clashes in most cases by picking the alternative which
would be preferred by overloading resolution. If none is, issue a
more intelligible error message than before.
@odersky odersky changed the title Print double definitions signatures at Typer Hande clashes between same-named exports Apr 20, 2022
odersky added 2 commits April 20, 2022 19:31
Print erased type if the message says "have the same type after erasure"
We should pick the one which is better, but we mistakenly chose the
worst one instead, since I misinterpreted the ordering.
Copy link
Member

@dwijnand dwijnand left a comment

Choose a reason for hiding this comment

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

Very nice

@dwijnand dwijnand merged commit c7c3c14 into scala:main Apr 22, 2022
@dwijnand dwijnand deleted the fix-14966 branch April 22, 2022 10:23
@bjornregnell
Copy link
Contributor

This is awesome!

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.

Strange error when exporting overloaded stuff from the collection library
4 participants