File tree 1 file changed +11
-4
lines changed
compiler/src/dotty/tools/dotc/core
1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -112,16 +112,23 @@ object Symbols extends SymUtils {
112
112
private def computeDenot (lastd : SymDenotation )(using Context ): SymDenotation = {
113
113
util.Stats .record(" Symbol.computeDenot" )
114
114
val now = ctx.period
115
+ val prev = checkedPeriod
115
116
checkedPeriod = now
116
- if (lastd.validFor contains now) lastd else recomputeDenot(lastd)
117
+ if lastd.validFor.contains(now) then
118
+ lastd
119
+ else
120
+ val newd = recomputeDenot(lastd)
121
+ if newd.exists then
122
+ lastDenot = newd
123
+ else
124
+ checkedPeriod = prev
125
+ newd
117
126
}
118
127
119
128
/** Overridden in NoSymbol */
120
129
protected def recomputeDenot (lastd : SymDenotation )(using Context ): SymDenotation = {
121
130
util.Stats .record(" Symbol.recomputeDenot" )
122
- val newd = lastd.current.asInstanceOf [SymDenotation ]
123
- lastDenot = newd
124
- newd
131
+ lastd.current.asSymDenotation
125
132
}
126
133
127
134
/** The original denotation of this symbol, without forcing anything */
You can’t perform that action at this time.
0 commit comments