Skip to content

Commit b2b2b05

Browse files
allanrenucciAllan Renucci
authored and
Allan Renucci
committed
First compiler run id is now InitialRunId instead of InitialRunId + 1
This is an attempt at fixing stale symbol errors
1 parent 374c30f commit b2b2b05

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,11 @@ class Compiler {
130130
List(new GenBCode) :: // Generate JVM bytecode
131131
Nil
132132

133-
var runId: Int = 1
134-
def nextRunId: Int = {
135-
runId += 1; runId
133+
private[this] var runId: Int = Periods.InitialRunId
134+
def nextRunId(): Int = {
135+
val next = runId
136+
runId += 1
137+
next
136138
}
137139

138140
def reset()(implicit ctx: Context): Unit = {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class Run(comp: Compiler, ictx: Context) extends ImplicitRunInfo with Constraint
4444
ctx.base.setPhasePlan(comp.phases)
4545
val rootScope = new MutableScope
4646
val bootstrap = ctx.fresh
47-
.setPeriod(Period(comp.nextRunId, FirstPhaseId))
47+
.setPeriod(Period(comp.nextRunId(), FirstPhaseId))
4848
.setScope(rootScope)
4949
rootScope.enter(ctx.definitions.RootPackage)(bootstrap)
5050
val start = bootstrap.fresh

0 commit comments

Comments
 (0)