Skip to content

Commit 0e9f17e

Browse files
committed
Also cache unsuccessful baseType computations
When testing on typer/*.scala, the differences are as follows: Cache all Only cache successful Total basetypes 386K 386K Full computations in recur 85K 397K Cache entries created 72K 46K
1 parent 3e8389a commit 0e9f17e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler/src/dotty/tools/dotc/core/SymDenotations.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1674,12 +1674,12 @@ object SymDenotations {
16741674
else NoType
16751675
else
16761676
recur(clsd.typeRef).asSeenFrom(prefix, clsd.owner)
1677-
if (baseTp.exists) record(tp, baseTp) else btrCache.remove(tp)
1677+
record(tp, baseTp)
16781678
baseTp
16791679
case _ =>
16801680
val superTp = tp.superType
16811681
val baseTp = recur(superTp)
1682-
if (baseTp.exists && inCache(superTp) && tp.symbol.maybeOwner.isType)
1682+
if (inCache(superTp) && tp.symbol.maybeOwner.isType)
16831683
record(tp, baseTp) // typeref cannot be a GADT, so cache is stable
16841684
else
16851685
btrCache.remove(tp)
@@ -1700,7 +1700,7 @@ object SymDenotations {
17001700
case tparams: List[Symbol @unchecked] =>
17011701
recur(tycon).subst(tparams, args)
17021702
}
1703-
if (baseTp.exists) record(tp, baseTp) else btrCache.remove(tp)
1703+
record(tp, baseTp)
17041704
baseTp
17051705
}
17061706
computeApplied

0 commit comments

Comments
 (0)