Skip to content

Commit 1b4be4b

Browse files
committed
First compiler run id is now InitialRunId instead of InitialRunId + 1
This is an attempt at fixing stale symbol errors
1 parent c8bd97c commit 1b4be4b

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
@@ -123,9 +123,11 @@ class Compiler {
123123
List(new GenBCode) :: // Generate JVM bytecode
124124
Nil
125125

126-
var runId: Int = 1
127-
def nextRunId: Int = {
128-
runId += 1; runId
126+
private[this] var runId: Int = Periods.InitialRunId
127+
def nextRunId(): Int = {
128+
val next = runId
129+
runId += 1
130+
next
129131
}
130132

131133
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)