Skip to content

Commit a7ff067

Browse files
committed
Refine fix: it suffices to reset constraints for unitCtx
1 parent 01587af commit a7ff067

File tree

3 files changed

+1
-2
lines changed

3 files changed

+1
-2
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ 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
206205
units = phase.runOn(units)
207206
profiler.afterPhase(phase, profileBefore)
208207
if (ctx.settings.Xprint.value.containsPhase(phase))

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ object Phases {
300300
def runOn(units: List[CompilationUnit])(using Context): List[CompilationUnit] =
301301
units.map { unit =>
302302
val unitCtx = ctx.fresh.setPhase(this.start).setCompilationUnit(unit).withRootImports
303+
unitCtx.typerState.constraint = OrderingConstraint.empty
303304
run(using unitCtx)
304305
unitCtx.compilationUnit
305306
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,6 @@ 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
460459
ctx.compilationUnit.tpdTree =
461460
atPhase(miniPhases.last.next)(transformUnit(ctx.compilationUnit.tpdTree))
462461

0 commit comments

Comments
 (0)