File tree 1 file changed +6
-5
lines changed
compiler/src/dotty/tools/dotc/core
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -122,13 +122,14 @@ object Symbols extends SymUtils {
122
122
protected def recomputeDenot (lastd : SymDenotation )(using Context ): SymDenotation = {
123
123
util.Stats .record(" Symbol.recomputeDenot" )
124
124
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
127
128
// We are trying to bring forward a symbol that is defined only at a later phase
128
129
// (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.
132
133
// See #15562 and test i15562b in ReplCompilerTests
133
134
checkedPeriod = lastd.initial.validFor
134
135
newd
You can’t perform that action at this time.
0 commit comments