Skip to content

Commit cbfead3

Browse files
oderskysmarter
authored andcommitted
Fix caching criterion
1 parent 79d9949 commit cbfead3

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
@@ -1902,9 +1902,8 @@ object Types {
19021902
*/
19031903
protected def computeSignature(implicit ctx: Context): Signature =
19041904
val lastd = lastDenotation
1905-
val isErased = ctx.erasedTypes
1906-
if lastd != null && !isErased then lastd.signature
1907-
else if isErased then computeSignature(using ctx.withPhase(ctx.erasurePhase))
1905+
if lastd != null && lastd.validFor.firstPhaseId <= ctx.erasurePhase.id then lastd.signature
1906+
else if ctx.erasedTypes then computeSignature(using ctx.withPhase(ctx.erasurePhase))
19081907
else symbol.asSeenFrom(prefix).signature
19091908

19101909
/** The signature of the current denotation if it is known without forcing.
@@ -1915,9 +1914,8 @@ object Types {
19151914
if ctx.runId == mySignatureRunId then mySignature
19161915
else
19171916
val lastd = lastDenotation
1918-
val isErased = ctx.erasedTypes
1919-
if lastd != null && !isErased then lastd.signature
1920-
else if isErased then currentSignature(using ctx.withPhase(ctx.erasurePhase))
1917+
if lastd != null && lastd.validFor.firstPhaseId <= ctx.erasurePhase.id then lastd.signature
1918+
else if ctx.erasedTypes then currentSignature(using ctx.withPhase(ctx.erasurePhase))
19211919
else
19221920
val sym = currentSymbol
19231921
if sym.exists then sym.asSeenFrom(prefix).signature

0 commit comments

Comments
 (0)