Skip to content

Commit 042c2f0

Browse files
committed
Fix #442.
There's a non-standard interaction between explicitOuter and Pattern matcher, as patmat can request outer symbols to be available earlier. Note that this fix makes code between pattern matcher & explicitOuter non-Ycheck-able, as patmat adds reference to future symbol.
1 parent cdbe81e commit 042c2f0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/dotty/tools/dotc/transform/PatternMatcher.scala

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -643,8 +643,12 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans
643643
// val outer = expectedTp.typeSymbol.newMethod(vpmName.outer, newFlags = SYNTHETIC | ARTIFACT) setInfo expectedTp.prefix
644644

645645
val expectedClass = expectedTp.dealias.classSymbol.asClass
646-
ExplicitOuter.ensureOuterAccessors(expectedClass)
647-
codegen._asInstanceOf(testedBinder, expectedTp).select(ExplicitOuter.outerAccessor(expectedClass)).select(defn.Object_eq).appliedTo(expectedOuter)
646+
val test = codegen._asInstanceOf(testedBinder, expectedTp)
647+
val outerAccessorTested = ctx.atPhase(ctx.explicitOuterPhase.next) { implicit ctx =>
648+
ExplicitOuter.ensureOuterAccessors(expectedClass)
649+
test.select(ExplicitOuter.outerAccessor(expectedClass)).select(defn.Object_eq).appliedTo(expectedOuter)
650+
}
651+
outerAccessorTested
648652
}
649653
}
650654

0 commit comments

Comments
 (0)