diff options
Diffstat (limited to 'src/dotty/tools/dotc/core/Contexts.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Contexts.scala | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/core/Contexts.scala b/src/dotty/tools/dotc/core/Contexts.scala index 8780b0bf6..b3d4845a7 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,7 @@ 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)) def withSetting[T](setting: Setting[T], value: T): this.type = withSettings(setting.updateIn(sstate, value)) |