diff options
-rw-r--r-- | src/dotty/tools/dotc/core/Contexts.scala | 9 | ||||
-rw-r--r-- | src/dotty/tools/dotc/core/Denotations.scala | 2 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/core/Contexts.scala b/src/dotty/tools/dotc/core/Contexts.scala index 8780b0bf6..9fbba9a0f 100644 --- a/src/dotty/tools/dotc/core/Contexts.scala +++ b/src/dotty/tools/dotc/core/Contexts.scala @@ -280,6 +280,11 @@ 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 = + withPhase(phase.id) + final def addMode(mode: Mode): Context = withMode(this.mode | mode) final def maskMode(mode: Mode): Context = withMode(this.mode & mode) final def retractMode(mode: Mode): Context = withMode(this.mode &~ mode) @@ -324,8 +329,8 @@ object Contexts { def withProperty(prop: (String, Any)): this.type = withMoreProperties(moreProperties + prop) - def withPhase(pid: PhaseId): this.type = withPeriod(Period(runId, pid)) - def withPhase(phase: Phase): this.type = withPhase(phase.id) + override def withPhase(pid: PhaseId): this.type = withPeriod(Period(runId, pid)) + override def withPhase(phase: Phase): this.type = withPhase(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/Denotations.scala b/src/dotty/tools/dotc/core/Denotations.scala index e15c70637..35f6bd56f 100644 --- a/src/dotty/tools/dotc/core/Denotations.scala +++ b/src/dotty/tools/dotc/core/Denotations.scala @@ -524,7 +524,7 @@ object Denotations { val transformer = ctx.denotTransformers(nextTranformerId) //println(s"transforming with $transformer") if (currentPeriod.lastPhaseId > transformer.id) - next = transformer.transform(cur).syncWithParents + next = transformer.transform(cur)(ctx.withPhase(startPid)).syncWithParents if (next eq cur) startPid = cur.validFor.firstPhaseId else { |