File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 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 {
112112 private def computeDenot (lastd : SymDenotation )(using Context ): SymDenotation = {
113113 util.Stats .record(" Symbol.computeDenot" )
114114 val now = ctx.period
115+ val prev = checkedPeriod
115116 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
117126 }
118127
119128 /** Overridden in NoSymbol */
120129 protected def recomputeDenot (lastd : SymDenotation )(using Context ): SymDenotation = {
121130 util.Stats .record(" Symbol.recomputeDenot" )
122- val newd = lastd.current.asInstanceOf [SymDenotation ]
123- lastDenot = newd
124- newd
131+ lastd.current.asSymDenotation
125132 }
126133
127134 /** The original denotation of this symbol, without forcing anything */
You can’t perform that action at this time.
0 commit comments