Skip to content

Commit e8a09cd

Browse files
committed
don't enter package to owner's scope
1 parent 51be882 commit e8a09cd

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/dotty/tools/dotc/core/Symbols.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ object Symbols {
428428
final def entered(implicit ctx: Context): this.type = {
429429
assert(this.owner.isClass, s"symbol ($this) entered the scope of non-class owner ${this.owner}") // !!! DEBUG
430430
this.owner.asClass.enter(this)
431-
if (this is Module) this.owner.asClass.enter(this.moduleClass)
431+
if (this.is(Module, butNot = Package)) this.owner.asClass.enter(this.moduleClass)
432432
this
433433
}
434434

src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,8 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
126126
* case x :: xs in class List would return the :: method).
127127
*/
128128
def qualifies(denot: Denotation): Boolean =
129-
reallyExists(denot) &&
130-
!(name.isTypeName && denot.symbol.is(Package)) &&
131-
!(pt.isInstanceOf[UnapplySelectionProto] &&
129+
reallyExists(denot) && !(
130+
pt.isInstanceOf[UnapplySelectionProto] &&
132131
(denot.symbol is (Method, butNot = Accessor)))
133132

134133
/** Find the denotation of enclosing `name` in given context `ctx`.

0 commit comments

Comments
 (0)