Skip to content

Commit 54a8539

Browse files
committed
Fix caching criterion
1 parent 406df2a commit 54a8539

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1895,9 +1895,8 @@ object Types {
18951895
*/
18961896
protected def computeSignature(implicit ctx: Context): Signature =
18971897
val lastd = lastDenotation
1898-
val isErased = ctx.erasedTypes
1899-
if lastd != null && !isErased then lastd.signature
1900-
else if isErased then computeSignature(using ctx.withPhase(ctx.erasurePhase))
1898+
if lastd != null && lastd.validFor.firstPhaseId <= ctx.erasurePhase.id then lastd.signature
1899+
else if ctx.erasedTypes then computeSignature(using ctx.withPhase(ctx.erasurePhase))
19011900
else symbol.asSeenFrom(prefix).signature
19021901

19031902
/** The signature of the current denotation if it is known without forcing.
@@ -1908,9 +1907,8 @@ object Types {
19081907
if ctx.runId == mySignatureRunId then mySignature
19091908
else
19101909
val lastd = lastDenotation
1911-
val isErased = ctx.erasedTypes
1912-
if lastd != null && !isErased then lastd.signature
1913-
else if isErased then currentSignature(using ctx.withPhase(ctx.erasurePhase))
1910+
if lastd != null && lastd.validFor.firstPhaseId <= ctx.erasurePhase.id then lastd.signature
1911+
else if ctx.erasedTypes then currentSignature(using ctx.withPhase(ctx.erasurePhase))
19141912
else
19151913
val sym = currentSymbol
19161914
if sym.exists then sym.asSeenFrom(prefix).signature

0 commit comments

Comments
 (0)