Skip to content

Commit 01587af

Browse files
committed
Constraints should not cross phases nor compilation units
1 parent 4c66271 commit 01587af

File tree

3 files changed

+2
-1
lines changed

3 files changed

+2
-1
lines changed

compiler/src/dotty/tools/dotc/Run.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ class Run(comp: Compiler, ictx: Context) extends ImplicitRunInfo with Constraint
202202
Stats.trackTime(s"$phase ms ") {
203203
val start = System.currentTimeMillis
204204
val profileBefore = profiler.beforePhase(phase)
205+
ctx.typerState.constraint = OrderingConstraint.empty
205206
units = phase.runOn(units)
206207
profiler.afterPhase(phase, profileBefore)
207208
if (ctx.settings.Xprint.value.containsPhase(phase))

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,6 @@ object TypeOps:
672672
val childTp = if (child.isTerm) child.termRef else child.typeRef
673673

674674
inContext(ctx.fresh.setExploreTyperState().setFreshGADTBounds) {
675-
ctx.typerState.constraint = OrderingConstraint.empty
676675
instantiateToSubType(childTp, parent).dealias
677676
}
678677
}

compiler/src/dotty/tools/dotc/transform/MegaPhase.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,7 @@ class MegaPhase(val miniPhases: Array[MiniPhase]) extends Phase {
456456
transformTrees(trees, start).asInstanceOf[List[T]]
457457

458458
override def run(using Context): Unit =
459+
ctx.typerState.constraint = OrderingConstraint.empty
459460
ctx.compilationUnit.tpdTree =
460461
atPhase(miniPhases.last.next)(transformUnit(ctx.compilationUnit.tpdTree))
461462

0 commit comments

Comments
 (0)