@@ -131,10 +131,10 @@ object Denotations {
131
131
/** The denotation with info(s) as seen from prefix type */
132
132
final def asSeenFrom (pre : Type )(using Context ): AsSeenFromResult =
133
133
if (Config .cacheAsSeenFrom) {
134
- if ((cachedPrefix ne pre) || ctx.period != validAsSeenFrom) {
134
+ if ((cachedPrefix ne pre) || currentPeriod != validAsSeenFrom) {
135
135
cachedAsSeenFrom = computeAsSeenFrom(pre)
136
136
cachedPrefix = pre
137
- validAsSeenFrom = if (pre.isProvisional) Nowhere else ctx.period
137
+ validAsSeenFrom = if (pre.isProvisional) Nowhere else currentPeriod
138
138
}
139
139
cachedAsSeenFrom
140
140
}
@@ -686,14 +686,14 @@ object Denotations {
686
686
687
687
private def updateValidity ()(using Context ): this .type = {
688
688
assert(
689
- ctx.runId >= validFor.runId
689
+ currentRunId >= validFor.runId
690
690
|| ctx.settings.YtestPickler .value // mixing test pickler with debug printing can travel back in time
691
691
|| ctx.mode.is(Mode .Printing ) // no use to be picky when printing error messages
692
692
|| symbol.isOneOf(ValidForeverFlags ),
693
- s " denotation $this invalid in run ${ctx.runId }. ValidFor: $validFor" )
693
+ s " denotation $this invalid in run ${currentRunId }. ValidFor: $validFor" )
694
694
var d : SingleDenotation = this
695
695
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)
697
697
d.invalidateInheritedInfo()
698
698
d = d.nextInRun
699
699
d ne this
@@ -720,7 +720,7 @@ object Denotations {
720
720
case _ =>
721
721
}
722
722
if (! symbol.exists) return updateValidity()
723
- if (! coveredInterval.containsPhaseId(ctx.phaseId )) return NoDenotation
723
+ if (! coveredInterval.containsPhaseId(currentPhaseId )) return NoDenotation
724
724
if (ctx.debug) traceInvalid(this )
725
725
staleSymbolError
726
726
}
@@ -746,7 +746,7 @@ object Denotations {
746
746
if (myValidFor.code <= 0 ) nextDefined else this
747
747
748
748
/** 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 )
750
750
* (even though this is not a precondition).
751
751
* If the runId of the context is the same as runId of this denotation,
752
752
* the right flock member is located, or, if it does not exist yet,
@@ -758,7 +758,7 @@ object Denotations {
758
758
* the symbol is stale, which constitutes an internal error.
759
759
*/
760
760
def current (using Context ): SingleDenotation = {
761
- val currentPeriod = ctx.period
761
+ val currentPeriod = Contexts .currentPeriod
762
762
val valid = myValidFor
763
763
if (valid.code <= 0 ) {
764
764
// can happen if we sit on a stale denotation which has been replaced
@@ -808,7 +808,7 @@ object Denotations {
808
808
else {
809
809
next match {
810
810
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" )
812
812
case _ =>
813
813
}
814
814
next.insertAfter(cur)
@@ -842,7 +842,7 @@ object Denotations {
842
842
}
843
843
844
844
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}"
846
846
847
847
/** Install this denotation to be the result of the given denotation transformer.
848
848
* This is the implementation of the same-named method in SymDenotations.
@@ -851,16 +851,16 @@ object Denotations {
851
851
*/
852
852
protected def installAfter (phase : DenotTransformer )(using Context ): Unit = {
853
853
val targetId = phase.next.id
854
- if (ctx.phaseId != targetId) atPhase(phase.next)(installAfter(phase))
854
+ if (currentPhaseId != targetId) atPhase(phase.next)(installAfter(phase))
855
855
else {
856
856
val current = symbol.current
857
857
// println(s"installing $this after $phase/${phase.id}, valid = ${current.validFor}")
858
858
// printPeriods(current)
859
- this .validFor = Period (ctx.runId , targetId, current.validFor.lastPhaseId)
859
+ this .validFor = Period (currentRunId , targetId, current.validFor.lastPhaseId)
860
860
if (current.validFor.firstPhaseId >= targetId)
861
861
current.replaceWith(this )
862
862
else {
863
- current.validFor = Period (ctx.runId , current.validFor.firstPhaseId, targetId - 1 )
863
+ current.validFor = Period (currentRunId , current.validFor.firstPhaseId, targetId - 1 )
864
864
insertAfter(current)
865
865
}
866
866
}
@@ -919,7 +919,7 @@ object Denotations {
919
919
case denot : SymDenotation => s " in ${denot.owner}"
920
920
case _ => " "
921
921
}
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 }"
923
923
}
924
924
925
925
/** The period (interval of phases) for which there exists
@@ -1071,7 +1071,7 @@ object Denotations {
1071
1071
class ErrorDenotation (using Context ) extends NonSymSingleDenotation (NoSymbol , NoType , NoType ) {
1072
1072
override def exists : Boolean = false
1073
1073
override def hasUniqueSym : Boolean = false
1074
- validFor = Period .allInRun(ctx.runId )
1074
+ validFor = Period .allInRun(currentRunId )
1075
1075
protected def newLikeThis (s : Symbol , i : Type , pre : Type ): SingleDenotation =
1076
1076
this
1077
1077
}
0 commit comments