Skip to content

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