Skip to content

Commit 3d5a2e2

Browse files
committed
Merge pull request #905 from dotty-staging/fix-nested-pkg-member-2
Fix nested pkg member 2
2 parents 80c2fbd + bf5f79c commit 3d5a2e2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,10 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
220220
val found =
221221
if (isSelfDenot(defDenot)) curOwner.enclosingClass.thisType
222222
else curOwner.thisType.select(name, defDenot)
223-
if (!(curOwner is Package) || (defDenot.symbol is Package) || isDefinedInCurrentUnit(defDenot))
223+
if (!(curOwner is Package) || isDefinedInCurrentUnit(defDenot))
224224
return checkNewOrShadowed(found, definition) // no need to go further out, we found highest prec entry
225+
else if (defDenot.symbol is Package)
226+
return checkNewOrShadowed(previous orElse found, packageClause)
225227
else if (prevPrec < packageClause)
226228
return findRef(found, packageClause, ctx)(outer)
227229
}

0 commit comments

Comments
 (0)