Skip to content

Commit 7fc1c2d

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 abe82eb commit 7fc1c2d

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

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

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