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