@@ -15,6 +15,7 @@ import Flags._
1515import DenotTransformers ._
1616import Decorators ._
1717import Signature .MatchDegree ._
18+ import Phases .currentPhase
1819import printing .Texts ._
1920import printing .Printer
2021import io .AbstractFile
@@ -758,7 +759,7 @@ object Denotations {
758759 * the symbol is stale, which constitutes an internal error.
759760 */
760761 def current (using Context ): SingleDenotation = {
761- val currentPeriod = Contexts .currentPeriod
762+ val now = Periods .currentPeriod
762763 val valid = myValidFor
763764 if (valid.code <= 0 ) {
764765 // can happen if we sit on a stale denotation which has been replaced
@@ -769,29 +770,29 @@ object Denotations {
769770 assert(false , this )
770771 }
771772
772- if (valid.runId != currentPeriod .runId)
773+ if (valid.runId != now .runId)
773774 if (exists) initial.bringForward().current
774775 else this
775776 else {
776777 var cur = this
777- if (currentPeriod .code > valid.code) {
778+ if (now .code > valid.code) {
778779 // search for containing period as long as nextInRun increases.
779780 var next = nextInRun
780- while (next.validFor.code > valid.code && ! (next.validFor contains currentPeriod )) {
781+ while (next.validFor.code > valid.code && ! (next.validFor contains now )) {
781782 cur = next
782783 next = next.nextInRun
783784 }
784785 if (next.validFor.code > valid.code) {
785- // in this case, next.validFor contains currentPeriod
786+ // in this case, next.validFor contains now
786787 cur = next
787788 cur
788789 }
789790 else {
790- // println(s"might need new denot for $cur, valid for ${cur.validFor} at $currentPeriod ")
791+ // println(s"might need new denot for $cur, valid for ${cur.validFor} at $now ")
791792 // not found, cur points to highest existing variant
792793 val nextTransformerId = ctx.base.nextDenotTransformerId(cur.validFor.lastPhaseId)
793- if (currentPeriod .lastPhaseId <= nextTransformerId)
794- cur.validFor = Period (currentPeriod .runId, cur.validFor.firstPhaseId, nextTransformerId)
794+ if (now .lastPhaseId <= nextTransformerId)
795+ cur.validFor = Period (now .runId, cur.validFor.firstPhaseId, nextTransformerId)
795796 else {
796797 var startPid = nextTransformerId + 1
797798 val transformer = ctx.base.denotTransformers(nextTransformerId)
@@ -814,19 +815,19 @@ object Denotations {
814815 next.insertAfter(cur)
815816 cur = next
816817 }
817- cur.validFor = Period (currentPeriod .runId, startPid, transformer.lastPhaseId)
818+ cur.validFor = Period (now .runId, startPid, transformer.lastPhaseId)
818819 // printPeriods(cur)
819820 // println(s"new denot: $cur, valid for ${cur.validFor}")
820821 }
821822 cur.current // multiple transformations could be required
822823 }
823824 }
824825 else {
825- // currentPeriod < end of valid; in this case a version must exist
826+ // now < end of valid; in this case a version must exist
826827 // but to be defensive we check for infinite loop anyway
827828 var cnt = 0
828- while (! (cur.validFor contains currentPeriod )) {
829- // println(s"searching: $cur at $currentPeriod , valid for ${cur.validFor}")
829+ while (! (cur.validFor contains now )) {
830+ // println(s"searching: $cur at $now , valid for ${cur.validFor}")
830831 cur = cur.nextInRun
831832 // Note: One might be tempted to add a `prev` field to get to the new denotation
832833 // more directly here. I tried that, but it degrades rather than improves
0 commit comments