-
Notifications
You must be signed in to change notification settings - Fork 21
Clarify spec for package syms #2458
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
Imported From: https://issues.scala-lang.org/browse/SI-2458?orig=1 |
@odersky said: Bindings of different kinds have a precedence defined on them: |
@Blaisorblade said: |
@retronym said: |
@retronym said: |
@retronym said: |
@retronym said: |
@gkossakowski said: |
@retronym said: |
@milessabin said: |
@som-snytt said: The spec help is scala/scala#5151 |
@som-snytt said: |
@som-snytt said: Note that it doesn't yet fix the pernicious package object paulpism at #9552. |
Uh oh!
There was an error while loading. Please reload this page.
According to SLS ch. 2 second para,
"Bindings of different kinds have a precedence defined on them: Definitions (local or inherited) have highest precedence, followed by explicit imports, followed by wildcard imports, followed by package members, which have lowest precedence."
However, scalac (both 2.7.x and trunk) behave differently as illustrated,
A.scala:
B.scala
scalac produces the following output,
indicating that the package-local definition p.BitSet has taken precedence over the explicit import of scala.collection.BitSet in B.scala.
The spec and the compiler should agree, and arguably the specified behaviour makes more intuitive sense than the current actual behaviour.
The text was updated successfully, but these errors were encountered: