We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
package app { package util { class C } package object util class D extends util.C { import p._ println(util.`package`) //def g = new util.C // error def f = test } } package p { package util { class Nope } package object util object test extends App { println(app.util.`package`) println(p.util.`package`) new app.D } }
app.util.package$@5afa04c p.util.package$@174d20a p.util.package$@174d20a
The import from p should not shadow a definition from app. Selection in D from util should be ambiguous.
p
app
D
util
The spec is slightly ambiguous about what a package is: "packages [packagings] are not introduced by a definition".
Therefore, the spec should not say "defined in the same compilation unit" but "introduced" to mean "defined or packaged".
The alternative interpretation is that the spec has nothing to say about package names because a package is not an entity.
scala/bug#11826
The text was updated successfully, but these errors were encountered:
the spec has nothing to say about package names
Actually, https://scala-lang.org/files/archive/spec/2.13/02-identifiers-names-and-scopes.html says
Note that a package definition is taken as lowest precedence...
but it's in the following body of the text, not in the enumeration of precedence levels.
The accompanying example is illustrative.
Sorry, something went wrong.
No branches or pull requests
Minimized code
Output
Expectation
The import from
p
should not shadow a definition fromapp
. Selection inD
fromutil
should be ambiguous.The spec is slightly ambiguous about what a package is: "packages [packagings] are not introduced by a definition".
Therefore, the spec should not say "defined in the same compilation unit" but "introduced" to mean "defined or packaged".
The alternative interpretation is that the spec has nothing to say about package names because a package is not an entity.
scala/bug#11826
The text was updated successfully, but these errors were encountered: