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