diff options
-rw-r--r-- | src/dotty/tools/dotc/core/Contexts.scala | 10 | ||||
-rw-r--r-- | src/dotty/tools/dotc/core/Periods.scala | 2 | ||||
-rw-r--r-- | src/dotty/tools/dotc/core/Phases.scala | 2 | ||||
-rw-r--r-- | src/dotty/tools/dotc/core/Types.scala | 2 | ||||
-rw-r--r-- | src/dotty/tools/dotc/transform/TreeTransform.scala | 2 |
5 files changed, 9 insertions, 9 deletions
diff --git a/src/dotty/tools/dotc/core/Contexts.scala b/src/dotty/tools/dotc/core/Contexts.scala index 9fbba9a0f..da684ea9c 100644 --- a/src/dotty/tools/dotc/core/Contexts.scala +++ b/src/dotty/tools/dotc/core/Contexts.scala @@ -280,9 +280,9 @@ object Contexts { final def withMode(mode: Mode): Context = if (mode != this.mode) fresh.withNewMode(mode) else this - def withPhase(phase: PhaseId): Context = - if (this.phaseId == phaseId) this else fresh.withPhase(phase) - def withPhase(phase: Phase): Context = + final def withPhase(phase: PhaseId): Context = + if (this.phaseId == phaseId) this else fresh.withNewPhase(phase) + final def withPhase(phase: Phase): Context = withPhase(phase.id) final def addMode(mode: Mode): Context = withMode(this.mode | mode) @@ -329,8 +329,8 @@ object Contexts { def withProperty(prop: (String, Any)): this.type = withMoreProperties(moreProperties + prop) - override def withPhase(pid: PhaseId): this.type = withPeriod(Period(runId, pid)) - override def withPhase(phase: Phase): this.type = withPhase(phase.id) + def withNewPhase(pid: PhaseId): this.type = withPeriod(Period(runId, pid)) + def withNewPhase(phase: Phase): this.type = withNewPhase(phase.id) def withSetting[T](setting: Setting[T], value: T): this.type = withSettings(setting.updateIn(sstate, value)) diff --git a/src/dotty/tools/dotc/core/Periods.scala b/src/dotty/tools/dotc/core/Periods.scala index 61f395c7d..6e1522e26 100644 --- a/src/dotty/tools/dotc/core/Periods.scala +++ b/src/dotty/tools/dotc/core/Periods.scala @@ -23,7 +23,7 @@ abstract class Periods extends DotClass { self: Context => /** Execute `op` at given phase id */ def atPhase[T](pid: PhaseId)(op: Context => T): T = - op(ctx.fresh.withPhase(pid)) + op(ctx.withPhase(pid)) /** The period containing the current period where denotations do not change. * We compute this by taking as first phase the first phase less or equal to diff --git a/src/dotty/tools/dotc/core/Phases.scala b/src/dotty/tools/dotc/core/Phases.scala index 7ae7b6ad3..ee993b890 100644 --- a/src/dotty/tools/dotc/core/Phases.scala +++ b/src/dotty/tools/dotc/core/Phases.scala @@ -163,7 +163,7 @@ object Phases { def run(implicit ctx: Context): Unit def runOn(units: List[CompilationUnit])(implicit ctx: Context): Unit = - for (unit <- units) run(ctx.fresh.withPhase(this).withCompilationUnit(unit)) + for (unit <- units) run(ctx.fresh.withNewPhase(this).withCompilationUnit(unit)) def description: String = name diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index 7cd66f5dd..501f01a74 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -1066,7 +1066,7 @@ object Types { if (d.exists || ctx.phaseId == FirstPhaseId) d else {// name has changed; try load in earlier phase and make current - val d = denot(ctx.fresh.withPhase(ctx.phaseId - 1)).current + val d = denot(ctx.withPhase(ctx.phaseId - 1)).current if (d.exists) d else throw new Error(s"failure to reload $this") } diff --git a/src/dotty/tools/dotc/transform/TreeTransform.scala b/src/dotty/tools/dotc/transform/TreeTransform.scala index 2fa2f3abb..10857da5a 100644 --- a/src/dotty/tools/dotc/transform/TreeTransform.scala +++ b/src/dotty/tools/dotc/transform/TreeTransform.scala @@ -484,7 +484,7 @@ object TreeTransforms { def transform(t: Tree)(implicit ctx: Context): Tree = { val initialTransformations = transformations - val contexts = initialTransformations.map(tr => ctx.fresh.withPhase(tr).ctx) + val contexts = initialTransformations.map(tr => ctx.withPhase(tr).ctx) val info = new TransformerInfo(initialTransformations, new NXTransformations(initialTransformations), this, contexts) initialTransformations.zipWithIndex.foreach{ case (transform, id) => |