@@ -929,7 +929,7 @@ object Denotations {
929929 // printPeriods(current)
930930 this .validFor = Period (ctx.runId, targetId, current.validFor.lastPhaseId)
931931 if (current.validFor.firstPhaseId >= targetId)
932- insertInsteadOf( current)
932+ current.replaceWith( this )
933933 else {
934934 current.validFor = Period (ctx.runId, current.validFor.firstPhaseId, targetId - 1 )
935935 insertAfter(current)
@@ -950,7 +950,7 @@ object Denotations {
950950 val current1 : SingleDenotation = f(current.asSymDenotation)
951951 if (current1 ne current) {
952952 current1.validFor = current.validFor
953- current1.insertInsteadOf(current )
953+ current.replaceWith(current1 )
954954 }
955955 hasNext = current1.nextInRun.validFor.code > current1.validFor.code
956956 current = current1.nextInRun
@@ -972,14 +972,14 @@ object Denotations {
972972 * The code to achieve this is subtle in that it works correctly
973973 * whether the replaced denotation is the only one in its cycle or not.
974974 */
975- private def insertInsteadOf ( old : SingleDenotation ): Unit = {
976- var prev = old
977- while (prev.nextInRun ne old ) prev = prev.nextInRun
975+ private [dotc] def replaceWith ( newd : SingleDenotation ): Unit = {
976+ var prev = this
977+ while (prev.nextInRun ne this ) prev = prev.nextInRun
978978 // order of next two assignments is important!
979- prev.nextInRun = this
980- this .nextInRun = old. nextInRun
981- old. validFor = Nowhere
982- old. nextInRun = this
979+ prev.nextInRun = newd
980+ newd .nextInRun = nextInRun
981+ validFor = Nowhere
982+ nextInRun = newd
983983 }
984984
985985 def staleSymbolError (implicit ctx : Context ) =
0 commit comments