aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Denotations.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools/dotc/core/Denotations.scala')
-rw-r--r--src/dotty/tools/dotc/core/Denotations.scala19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/dotty/tools/dotc/core/Denotations.scala b/src/dotty/tools/dotc/core/Denotations.scala
index ceb996171..849e934f0 100644
--- a/src/dotty/tools/dotc/core/Denotations.scala
+++ b/src/dotty/tools/dotc/core/Denotations.scala
@@ -476,12 +476,14 @@ object Denotations {
/** The version of this SingleDenotation that was valid in the first phase
* of this run.
*/
- def initial: SingleDenotation = {
- var current = nextInRun
- while (current.validFor.code > this.myValidFor.code) current = current.nextInRun
- current
- }
-
+ def initial: SingleDenotation =
+ if (validFor == Nowhere) this
+ else {
+ var current = nextInRun
+ while (current.validFor.code > this.myValidFor.code) current = current.nextInRun
+ current
+ }
+
def history: List[SingleDenotation] = {
val b = new ListBuffer[SingleDenotation]
var current = initial
@@ -615,16 +617,13 @@ object Denotations {
val current = symbol.current
// println(s"installing $this after $phase/${phase.id}, valid = ${current.validFor}")
// printPeriods(current)
- if (current.nextInRun ne current)
- this.nextInRun = current.nextInRun
- else
- this.nextInRun = this
this.validFor = Period(ctx.runId, targetId, current.validFor.lastPhaseId)
if (current.validFor.firstPhaseId == targetId) {
// replace current with this denotation
var prev = current
while (prev.nextInRun ne current) prev = prev.nextInRun
prev.nextInRun = this
+ this.nextInRun = current.nextInRun
current.validFor = Nowhere
} else {
// insert this denotation after current