diff options
author | liu fengyun <liu@fengy.me> | 2016-11-17 10:17:45 +0100 |
---|---|---|
committer | liu fengyun <liu@fengy.me> | 2016-11-17 10:17:45 +0100 |
commit | e8a09cd0e21d4d51fb877ddd4d2b0c409ff906b9 (patch) | |
tree | d11a67adf5d2f73b37a03e543278541c014dac77 | |
parent | 51be882adb6f055c1cf924167f8fab7edb82d721 (diff) | |
download | dotty-e8a09cd0e21d4d51fb877ddd4d2b0c409ff906b9.tar.gz dotty-e8a09cd0e21d4d51fb877ddd4d2b0c409ff906b9.tar.bz2 dotty-e8a09cd0e21d4d51fb877ddd4d2b0c409ff906b9.zip |
don't enter package to owner's scope
-rw-r--r-- | src/dotty/tools/dotc/core/Symbols.scala | 2 | ||||
-rw-r--r-- | src/dotty/tools/dotc/typer/Typer.scala | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/core/Symbols.scala b/src/dotty/tools/dotc/core/Symbols.scala index 38b2c8bd6..b5bd196d2 100644 --- a/src/dotty/tools/dotc/core/Symbols.scala +++ b/src/dotty/tools/dotc/core/Symbols.scala @@ -428,7 +428,7 @@ object Symbols { final def entered(implicit ctx: Context): this.type = { assert(this.owner.isClass, s"symbol ($this) entered the scope of non-class owner ${this.owner}") // !!! DEBUG this.owner.asClass.enter(this) - if (this is Module) this.owner.asClass.enter(this.moduleClass) + if (this.is(Module, butNot = Package)) this.owner.asClass.enter(this.moduleClass) this } diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala index 32d4a8336..667e1f82e 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -126,9 +126,8 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit * case x :: xs in class List would return the :: method). */ def qualifies(denot: Denotation): Boolean = - reallyExists(denot) && - !(name.isTypeName && denot.symbol.is(Package)) && - !(pt.isInstanceOf[UnapplySelectionProto] && + reallyExists(denot) && !( + pt.isInstanceOf[UnapplySelectionProto] && (denot.symbol is (Method, butNot = Accessor))) /** Find the denotation of enclosing `name` in given context `ctx`. |