Skip to content

Commit 25af814

Browse files
committed
Fix installAfter for a Denotation List of single denotation
1 parent d01ecb7 commit 25af814

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/dotty/tools/dotc/core/Denotations.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,10 @@ object Denotations {
611611
val current = symbol.current
612612
// println(s"installing $this after $phase/${phase.id}, valid = ${current.validFor}")
613613
// printPeriods(current)
614-
this.nextInRun = current.nextInRun
614+
if (current.nextInRun ne current)
615+
this.nextInRun = current.nextInRun
616+
else
617+
this.nextInRun = this
615618
this.validFor = Period(ctx.runId, targetId, current.validFor.lastPhaseId)
616619
if (current.validFor.firstPhaseId == targetId) {
617620
// replace current with this denotation
@@ -622,6 +625,7 @@ object Denotations {
622625
} else {
623626
// insert this denotation after current
624627
current.validFor = Period(ctx.runId, current.validFor.firstPhaseId, targetId - 1)
628+
this.nextInRun = current.nextInRun
625629
current.nextInRun = this
626630
}
627631
// printPeriods(this)

0 commit comments

Comments
 (0)