@@ -131,10 +131,10 @@ object Denotations {
131131 /** The denotation with info(s) as seen from prefix type */
132132 final def asSeenFrom (pre : Type )(using Context ): AsSeenFromResult =
133133 if (Config .cacheAsSeenFrom) {
134- if ((cachedPrefix ne pre) || ctx.period != validAsSeenFrom) {
134+ if ((cachedPrefix ne pre) || currentPeriod != validAsSeenFrom) {
135135 cachedAsSeenFrom = computeAsSeenFrom(pre)
136136 cachedPrefix = pre
137- validAsSeenFrom = if (pre.isProvisional) Nowhere else ctx.period
137+ validAsSeenFrom = if (pre.isProvisional) Nowhere else currentPeriod
138138 }
139139 cachedAsSeenFrom
140140 }
@@ -686,14 +686,14 @@ object Denotations {
686686
687687 private def updateValidity ()(using Context ): this .type = {
688688 assert(
689- ctx.runId >= validFor.runId
689+ currentRunId >= validFor.runId
690690 || ctx.settings.YtestPickler .value // mixing test pickler with debug printing can travel back in time
691691 || ctx.mode.is(Mode .Printing ) // no use to be picky when printing error messages
692692 || symbol.isOneOf(ValidForeverFlags ),
693- s " denotation $this invalid in run ${ctx.runId }. ValidFor: $validFor" )
693+ s " denotation $this invalid in run ${currentRunId }. ValidFor: $validFor" )
694694 var d : SingleDenotation = this
695695 while ({
696- d.validFor = Period (ctx.period .runId, d.validFor.firstPhaseId, d.validFor.lastPhaseId)
696+ d.validFor = Period (currentPeriod .runId, d.validFor.firstPhaseId, d.validFor.lastPhaseId)
697697 d.invalidateInheritedInfo()
698698 d = d.nextInRun
699699 d ne this
@@ -720,7 +720,7 @@ object Denotations {
720720 case _ =>
721721 }
722722 if (! symbol.exists) return updateValidity()
723- if (! coveredInterval.containsPhaseId(ctx.phaseId )) return NoDenotation
723+ if (! coveredInterval.containsPhaseId(currentPhaseId )) return NoDenotation
724724 if (ctx.debug) traceInvalid(this )
725725 staleSymbolError
726726 }
@@ -746,7 +746,7 @@ object Denotations {
746746 if (myValidFor.code <= 0 ) nextDefined else this
747747
748748 /** Produce a denotation that is valid for the given context.
749- * Usually called when !(validFor contains ctx.period )
749+ * Usually called when !(validFor contains currentPeriod )
750750 * (even though this is not a precondition).
751751 * If the runId of the context is the same as runId of this denotation,
752752 * the right flock member is located, or, if it does not exist yet,
@@ -758,7 +758,7 @@ object Denotations {
758758 * the symbol is stale, which constitutes an internal error.
759759 */
760760 def current (using Context ): SingleDenotation = {
761- val currentPeriod = ctx.period
761+ val currentPeriod = Contexts .currentPeriod
762762 val valid = myValidFor
763763 if (valid.code <= 0 ) {
764764 // can happen if we sit on a stale denotation which has been replaced
@@ -808,7 +808,7 @@ object Denotations {
808808 else {
809809 next match {
810810 case next : ClassDenotation =>
811- assert(! next.is(Package ), s " illegal transformation of package denotation by transformer ${ctx.withPhase( transformer).phase} " )
811+ assert(! next.is(Package ), s " illegal transformation of package denotation by transformer $transformer" )
812812 case _ =>
813813 }
814814 next.insertAfter(cur)
@@ -842,7 +842,7 @@ object Denotations {
842842 }
843843
844844 private def demandOutsideDefinedMsg (using Context ): String =
845- s " demanding denotation of $this at phase ${ctx.phase }( ${ctx.phaseId }) outside defined interval: defined periods are ${definedPeriodsString}"
845+ s " demanding denotation of $this at phase ${currentPhase }( ${currentPhaseId }) outside defined interval: defined periods are ${definedPeriodsString}"
846846
847847 /** Install this denotation to be the result of the given denotation transformer.
848848 * This is the implementation of the same-named method in SymDenotations.
@@ -851,16 +851,16 @@ object Denotations {
851851 */
852852 protected def installAfter (phase : DenotTransformer )(using Context ): Unit = {
853853 val targetId = phase.next.id
854- if (ctx.phaseId != targetId) atPhase(phase.next)(installAfter(phase))
854+ if (currentPhaseId != targetId) atPhase(phase.next)(installAfter(phase))
855855 else {
856856 val current = symbol.current
857857 // println(s"installing $this after $phase/${phase.id}, valid = ${current.validFor}")
858858 // printPeriods(current)
859- this .validFor = Period (ctx.runId , targetId, current.validFor.lastPhaseId)
859+ this .validFor = Period (currentRunId , targetId, current.validFor.lastPhaseId)
860860 if (current.validFor.firstPhaseId >= targetId)
861861 current.replaceWith(this )
862862 else {
863- current.validFor = Period (ctx.runId , current.validFor.firstPhaseId, targetId - 1 )
863+ current.validFor = Period (currentRunId , current.validFor.firstPhaseId, targetId - 1 )
864864 insertAfter(current)
865865 }
866866 }
@@ -919,7 +919,7 @@ object Denotations {
919919 case denot : SymDenotation => s " in ${denot.owner}"
920920 case _ => " "
921921 }
922- s " stale symbol; $this# ${symbol.id} $ownerMsg, defined in ${myValidFor}, is referred to in run ${ctx.period }"
922+ s " stale symbol; $this# ${symbol.id} $ownerMsg, defined in ${myValidFor}, is referred to in run ${currentPeriod }"
923923 }
924924
925925 /** The period (interval of phases) for which there exists
@@ -1071,7 +1071,7 @@ object Denotations {
10711071 class ErrorDenotation (using Context ) extends NonSymSingleDenotation (NoSymbol , NoType , NoType ) {
10721072 override def exists : Boolean = false
10731073 override def hasUniqueSym : Boolean = false
1074- validFor = Period .allInRun(ctx.runId )
1074+ validFor = Period .allInRun(currentRunId )
10751075 protected def newLikeThis (s : Symbol , i : Type , pre : Type ): SingleDenotation =
10761076 this
10771077 }
0 commit comments