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 @@ -107,16 +107,23 @@ object Symbols extends SymUtils {
107
107
private def computeDenot (lastd : SymDenotation )(using Context ): SymDenotation = {
108
108
util.Stats .record(" Symbol.computeDenot" )
109
109
val now = ctx.period
110
+ val prev = checkedPeriod
110
111
checkedPeriod = now
111
- if (lastd.validFor contains now) lastd else recomputeDenot(lastd)
112
+ if lastd.validFor.contains(now) then
113
+ lastd
114
+ else
115
+ val newd = recomputeDenot(lastd)
116
+ if newd.exists then
117
+ lastDenot = newd
118
+ else
119
+ checkedPeriod = prev
120
+ newd
112
121
}
113
122
114
123
/** Overridden in NoSymbol */
115
124
protected def recomputeDenot (lastd : SymDenotation )(using Context ): SymDenotation = {
116
125
util.Stats .record(" Symbol.recomputeDenot" )
117
- val newd = lastd.current.asInstanceOf [SymDenotation ]
118
- lastDenot = newd
119
- newd
126
+ lastd.current.asSymDenotation
120
127
}
121
128
122
129
/** The original denotation of this symbol, without forcing anything */
You can’t perform that action at this time.
0 commit comments