Skip to content

Scala 2.13.x import precedence not respected #11617

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

Closed
rbarazzutti opened this issue Jul 7, 2019 · 4 comments
Closed

Scala 2.13.x import precedence not respected #11617

rbarazzutti opened this issue Jul 7, 2019 · 4 comments

Comments

@rbarazzutti
Copy link

Local classes should have precedence over classes imported with wildcards (as in Java)

Scala 2.10.x, 2.11.x, and 2.12.x are respecting this precedence and thus are behaving like Java.

Oppositely, Scala 2.13.x takes the class imported with a wildcard.

@NthPortal
Copy link

duplicate of #11593?

@rbarazzutti
Copy link
Author

The release notes of Scala 2.13.0 mention the precedence of explicit imports, but not wildcards, it is somehow misleading.

Otherwise, thanks @NthPortal, it's a dup.

@som-snytt
Copy link

Yes, it's not easy to summarize in a one-liner. (The summary is also misleading because it's kind of wrong.)

I'll try to transfer words from the linked ticket to an "overview" page in the docs. That may be useful later as a point of reference for Scala 3 import/export.

I also see that I proposed a lint option. Or maybe --explain-imports as a companion to --explain-types. After all, types are self-explanatory, but imports are magic.

@SethTisue
Copy link
Member

I changed the release notes wording from "Explicit imports" to "Imports, including wildcard imports"

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

No branches or pull requests

4 participants