File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -122,15 +122,16 @@ object Symbols extends SymUtils {
122122 protected def recomputeDenot (lastd : SymDenotation )(using Context ): SymDenotation = {
123123 util.Stats .record(" Symbol.recomputeDenot" )
124124 val newd = lastd.current.asInstanceOf [SymDenotation ]
125- lastDenot = newd
126- if ! newd.exists && lastd.initial.validFor.firstPhaseId > ctx.phaseId then
125+ if newd.exists || lastd.initial.validFor.firstPhaseId <= ctx.phaseId then
126+ lastDenot = newd
127+ else
127128 // We are trying to bring forward a symbol that is defined only at a later phase
128129 // (typically, a nested Java class, invisible before erasure).
129- // In that case, keep the checked period to the previous validity, which
130- // means we will try another bring forward when the symbol is referenced
131- // at a later phase. Otherwise we'd get stuck on NoDenotation here.
130+ // In that case, keep lastDenot as it was and set the checked period to lastDenot's
131+ // previous validity, which means we will try another bring forward when the symbol
132+ // is referenced at a later phase. Otherwise we'd get stuck on NoDenotation here.
132133 // See #15562 and test i15562b in ReplCompilerTests
133- checkedPeriod = lastd.initial. validFor
134+ checkedPeriod = lastd.validFor
134135 newd
135136 }
136137
You can’t perform that action at this time.
0 commit comments