aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Denotations.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-03-15 17:10:24 +0100
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2014-03-18 16:06:33 +0100
commit1dbf020c43639b0c37e9005f2692871d39676ac7 (patch)
treeb1855130096b99917845a715344ba6a768ede1fc /src/dotty/tools/dotc/core/Denotations.scala
parent76ea699ac1a76ee6048d7fe8239d0a1126581429 (diff)
downloaddotty-1dbf020c43639b0c37e9005f2692871d39676ac7.tar.gz
dotty-1dbf020c43639b0c37e9005f2692871d39676ac7.tar.bz2
dotty-1dbf020c43639b0c37e9005f2692871d39676ac7.zip
Refactored denotation transformers
Many small and large changes. Added samplePhase to demonstrate functionality. To test functioning, run the compiler with args tests/pos/uncurry.scala -Ylog:sample,terminal
Diffstat (limited to 'src/dotty/tools/dotc/core/Denotations.scala')
-rw-r--r--src/dotty/tools/dotc/core/Denotations.scala11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/core/Denotations.scala b/src/dotty/tools/dotc/core/Denotations.scala
index bd1aedd75..b35647ead 100644
--- a/src/dotty/tools/dotc/core/Denotations.scala
+++ b/src/dotty/tools/dotc/core/Denotations.scala
@@ -390,7 +390,6 @@ object Denotations {
if ((symbol eq this.symbol) && (info eq this.info)) this
else newLikeThis(symbol, info)
-
def orElse(that: => SingleDenotation) = if (this.exists) this else that
def altsWith(p: Symbol => Boolean): List[SingleDenotation] =
@@ -518,7 +517,8 @@ object Denotations {
} else {
// not found, cur points to highest existing variant
var startPid = cur.validFor.lastPhaseId + 1
- val transformer = ctx.denotTransformers.nextTransformer(startPid)
+ val transformer = ctx.phases(startPid - 1).asInstanceOf[DenotTransformer]
+ //println(s"transforming with $transformer")
next = transformer.transform(cur).syncWithParents
if (next eq cur)
startPid = cur.validFor.firstPhaseId
@@ -527,20 +527,23 @@ object Denotations {
case next: ClassDenotation => next.resetFlag(Frozen)
case _ =>
}
+ next.nextInRun = cur.nextInRun
cur.nextInRun = next
cur = next
}
cur.validFor = Period(
currentPeriod.runId, startPid, transformer.lastPhaseId)
+ //println(s"new denot: $cur, valid for ${cur.validFor}")
}
} else {
- // currentPeriod < valid; in this case a version must exist
+ // currentPeriod < end of valid; in this case a version must exist
// but to be defensive we check for infinite loop anyway
var cnt = 0
while (!(cur.validFor contains currentPeriod)) {
+ //println(s"searching: $cur at $currentPeriod, valid for ${cur.validFor}")
cur = cur.nextInRun
cnt += 1
- assert(cnt <= MaxPossiblePhaseId, "seems to be a loop in Denotations")
+ assert(cnt <= MaxPossiblePhaseId, s"seems to be a loop in Denotations for $this, currentPeriod = $currentPeriod")
}
}
cur