Skip to content

Commit dd80312

Browse files
committed
Fix CC asSeenFrom when prefix is this
1 parent b3c4717 commit dd80312

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

compiler/src/dotty/tools/dotc/core/TypeOps.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import typer.ForceDegree
1919
import typer.Inferencing._
2020
import typer.IfBottom
2121
import reporting.TestingReporter
22-
import cc.{CapturingType, derivedCapturingType, CaptureSet, isBoxed, isBoxedCapturing}
22+
import cc.{CapturingType, derivedCapturingType, CaptureSet, isBoxed, isBoxedCapturing, isLevelOwner, localRoot}
2323
import CaptureSet.{CompareResult, IdempotentCaptRefMap, IdentityCaptRefMap}
2424

2525
import scala.annotation.internal.sharable
@@ -96,8 +96,9 @@ object TypeOps:
9696
def mapLocalRoot(tp: TermRef): Type =
9797
if tp.symbol.owner.isLocalDummy then
9898
val pre1 = toPrefix(pre, cls, tp.localRootOwner.asClass)
99-
if pre1 ne tp then pre1.captureSet.impliedRoot(tp)
100-
.showing(i"map local root $tp from $pre to $result", ccSetup)
99+
if pre1 ne tp then pre1 match
100+
case pre1: ThisType if pre1.cls.isLevelOwner => pre1.cls.localRoot.termRef
101+
case _ => pre1.captureSet.impliedRoot(tp)
101102
else tp
102103
else tp
103104

0 commit comments

Comments
 (0)