Skip to content

Commit d9e13e5

Browse files
committed
Revert cache for signature in denot
1 parent 69c16f8 commit d9e13e5

File tree

1 file changed

+2
-26
lines changed

1 file changed

+2
-26
lines changed

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

+2-26
Original file line numberDiff line numberDiff line change
@@ -626,30 +626,6 @@ object Denotations {
626626
throw ex
627627
case _ => Signature.NotAMethod
628628

629-
private var myCurrentJavaSig: Signature = uninitialized
630-
private var myCurrentJavaSigRunId: RunId = NoRunId
631-
private var myCurrentScala2Sig: Signature = uninitialized
632-
private var myCurrentScala2SigRunId: RunId = NoRunId
633-
private var myCurrentSig: Signature = uninitialized
634-
private var myCurrentSigRunId: RunId = NoRunId
635-
636-
def currentSignature(sourceLanguage: SourceLanguage)(using Context): Signature = sourceLanguage match
637-
case SourceLanguage.Java =>
638-
if myCurrentJavaSigRunId != ctx.runId then
639-
myCurrentJavaSig = signature(sourceLanguage)
640-
myCurrentJavaSigRunId = ctx.runId
641-
myCurrentJavaSig
642-
case SourceLanguage.Scala2 =>
643-
if myCurrentScala2SigRunId != ctx.runId then
644-
myCurrentScala2Sig = signature(sourceLanguage)
645-
myCurrentScala2SigRunId = ctx.runId
646-
myCurrentScala2Sig
647-
case SourceLanguage.Scala3 =>
648-
if myCurrentSigRunId != ctx.runId then
649-
myCurrentSig = signature(sourceLanguage)
650-
myCurrentSigRunId = ctx.runId
651-
myCurrentSig
652-
653629
def derivedSingleDenotation(symbol: Symbol, info: Type, pre: Type = this.prefix, isRefinedMethod: Boolean = this.isRefinedMethod)(using Context): SingleDenotation =
654630
if ((symbol eq this.symbol) && (info eq this.info) && (pre eq this.prefix) && (isRefinedMethod == this.isRefinedMethod)) this
655631
else newLikeThis(symbol, info, pre, isRefinedMethod)
@@ -1057,8 +1033,8 @@ object Denotations {
10571033
val thisLanguage = SourceLanguage(symbol)
10581034
val otherLanguage = SourceLanguage(other.symbol)
10591035
val commonLanguage = SourceLanguage.commonLanguage(thisLanguage, otherLanguage)
1060-
val sig = currentSignature(commonLanguage)
1061-
val otherSig = other.currentSignature(commonLanguage)
1036+
val sig = signature(commonLanguage)
1037+
val otherSig = other.signature(commonLanguage)
10621038
sig.matchDegree(otherSig) match
10631039
case FullMatch =>
10641040
!alwaysCompareTypes || info.matches(other.info)

0 commit comments

Comments
 (0)