Skip to content

Commit 972f6d5

Browse files
authored
Merge pull request #2952 from dotty-staging/fix-#2636
Fix #2636: Move last phase period assertion
2 parents c5f4e47 + 23aceb1 commit 972f6d5

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import scala.util.control.NonFatal
2424
/** A compiler run. Exports various methods to compile source files */
2525
class Run(comp: Compiler)(implicit ctx: Context) {
2626

27-
assert(comp.phases.last.last.id <= Periods.MaxPossiblePhaseId)
2827
assert(ctx.runId <= Periods.MaxPossibleRunId)
2928

3029
var units: List[CompilationUnit] = _

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ object Phases {
348348
protected[Phases] def init(base: ContextBase, start: Int, end:Int): Unit = {
349349
if (start >= FirstPhaseId)
350350
assert(myPeriod == Periods.InvalidPeriod, s"phase $this has already been used once; cannot be reused")
351+
assert(start <= Periods.MaxPossiblePhaseId, s"Too many phases, Period bits overflow")
351352
myBase = base
352353
myPeriod = Period(NoRunId, start, end)
353354
myErasedTypes = prev.getClass == classOf[Erasure] || prev.erasedTypes

0 commit comments

Comments
 (0)