aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Petrashko <dmitry.petrashko@gmail.com>2014-03-24 18:38:17 +0100
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2014-03-24 18:46:24 +0100
commit7c5dd005fcb34966b87ccef65e1a51d24da4d7b9 (patch)
tree430dae8f10a6495fdba337efa56c3e6cd4a2bcf1
parent83449e14d55a37e4925dc05701f35c6e89cbf2f6 (diff)
parentd9463d7f79f936b7082ce5498d121229e45977a7 (diff)
downloaddotty-7c5dd005fcb34966b87ccef65e1a51d24da4d7b9.tar.gz
dotty-7c5dd005fcb34966b87ccef65e1a51d24da4d7b9.tar.bz2
dotty-7c5dd005fcb34966b87ccef65e1a51d24da4d7b9.zip
Merge pull request #89 from dotty-staging/fix/transform-contexts
Fix phase of context for denotation transformer
-rw-r--r--src/dotty/tools/dotc/core/Contexts.scala9
-rw-r--r--src/dotty/tools/dotc/core/Denotations.scala2
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 {