File tree 1 file changed +11
-10
lines changed
compiler/src/dotty/tools/dotc/core 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -415,18 +415,19 @@ object Symbols {
415
415
else computeDenot(lastd)
416
416
}
417
417
418
- protected def computeDenot (lastd : SymDenotation )(implicit ctx : Context ): SymDenotation = {
418
+ private def computeDenot (lastd : SymDenotation )(implicit ctx : Context ): SymDenotation = {
419
419
val now = ctx.period
420
420
checkedPeriod = now
421
- if (lastd.validFor contains now) {
422
- lastd
423
- } else {
424
- val newd = lastd.current.asInstanceOf [SymDenotation ]
425
- lastDenot = newd
426
- newd
427
- }
421
+ if (lastd.validFor contains now) lastd else recomputeDenot(lastd)
422
+ }
423
+
424
+ /** Overridden in NoSymbol */
425
+ protected def recomputeDenot (lastd : SymDenotation )(implicit ctx : Context ) = {
426
+ val newd = lastd.current.asInstanceOf [SymDenotation ]
427
+ lastDenot = newd
428
+ newd
428
429
}
429
-
430
+
430
431
/** The initial denotation of this symbol, without going through `current` */
431
432
final def initialDenot (implicit ctx : Context ): SymDenotation =
432
433
lastDenot.initial
@@ -646,7 +647,7 @@ object Symbols {
646
647
@ sharable object NoSymbol extends Symbol (NoCoord , 0 ) {
647
648
denot = NoDenotation
648
649
override def associatedFile (implicit ctx : Context ): AbstractFile = NoSource .file
649
- override def computeDenot (lastd : SymDenotation )(implicit ctx : Context ): SymDenotation = NoDenotation
650
+ override def recomputeDenot (lastd : SymDenotation )(implicit ctx : Context ): SymDenotation = NoDenotation
650
651
}
651
652
652
653
implicit class Copier [N <: Name ](sym : Symbol { type ThisName = N })(implicit ctx : Context ) {
You can’t perform that action at this time.
0 commit comments