Skip to content

Commit 28cb972

Browse files
committed
Fix outer selection
1 parent 28a8761 commit 28cb972

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

compiler/src/dotty/tools/dotc/transform/init/Semantic.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,9 +1321,10 @@ object Semantic {
13211321
*/
13221322
def resolveOuterSelect(target: ClassSymbol, thisV: Value, hops: Int, source: Tree): Contextual[Value] = log("resolving outer " + target.show + ", this = " + thisV.show + ", hops = " + hops, printer, (_: Value).show) {
13231323
// Is `target` reachable from `cls` with the given `hops`?
1324-
def reachable(cls: ClassSymbol, hops: Int): Boolean =
1324+
def reachable(cls: ClassSymbol, hops: Int): Boolean = log("reachable from " + cls + " -> " + target + " in " + hops, printer) {
13251325
if hops == 0 then cls == target
1326-
else reachable(cls.lexicallyEnclosingClass.asClass, hops - 1)
1326+
else reachable(cls.owner.lexicallyEnclosingClass.asClass, hops - 1)
1327+
}
13271328

13281329
thisV match
13291330
case Hot => Hot

0 commit comments

Comments
 (0)