aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Contexts.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-03-21 16:41:24 +0100
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2014-03-24 17:54:58 +0100
commitd9463d7f79f936b7082ce5498d121229e45977a7 (patch)
treeb9da3718c46f6f7cfdb86c1bf0527ef920f81d4b /src/dotty/tools/dotc/core/Contexts.scala
parentb5864b48d04adf6cab1dbe58d394ad608dafd440 (diff)
downloaddotty-d9463d7f79f936b7082ce5498d121229e45977a7.tar.gz
dotty-d9463d7f79f936b7082ce5498d121229e45977a7.tar.bz2
dotty-d9463d7f79f936b7082ce5498d121229e45977a7.zip
Fix phase of context for denotation transformer
The phase is now always the phase on which the denotation transformer is defined.
Diffstat (limited to 'src/dotty/tools/dotc/core/Contexts.scala')
-rw-r--r--src/dotty/tools/dotc/core/Contexts.scala8
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))