Skip to content

Commit 8636508

Browse files
DarkDimiusnicolasstucki
authored andcommitted
Phases: test for too many phases
1 parent 6b82a6f commit 8636508

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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)