Skip to content

Commit cf1f591

Browse files
committed
Fix scala#2636: Move last phase period assetrion
1 parent 4dc27d2 commit cf1f591

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,14 @@ class Compiler {
108108
new CollectSuperCalls, // Find classes that are called with super
109109
new DropInlined, // Drop Inlined nodes, since backend has no use for them
110110
new LabelDefs), // Converts calls to labels to jumps
111-
List(new GenBCode) // Generate JVM bytecode
111+
List(checkedIdOverflow(new GenBCode)) // Generate JVM bytecode
112112
)
113113

114+
private def checkedIdOverflow(phase: Phase): Phase = {
115+
assert(phase.id <= Periods.MaxPossiblePhaseId)
116+
phase
117+
}
118+
114119
var runId = 1
115120
def nextRunId = {
116121
runId += 1; runId

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] = _

0 commit comments

Comments
 (0)