-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Wildcard-imported name takes presedence over name in same package #9899
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
Comments
This is working as I would expect, because I don't know offhand why scala 2 is wrong, but I just noticed that package name binding is inherently strange.
|
Indeed, Scala 2 was wrong here. |
My previous comment was incorrect. Package names are term names, even though they have the special property that a type name is not allowed to peacefully coexist.
The test case is about name space and not precedence, although it appears to be induced by precedence. Another view:
Either definition of y.C is ok in Scala 2, but package y.C induces ambiguity in Scala 3. Verifying what should be obvious but taking nothing for granted, this compiles:
|
Uh oh!
There was an error while loading. Please reload this page.
Minimized code
Given these files
Output
With scala 2.13.3
class Test extends internal
resolves toclass Test extends B.internal
and compiles file.In dotty it resolves to
class Test extends A.internal
and fails with:Expectation
Should work like before
The text was updated successfully, but these errors were encountered: