@@ -621,6 +621,30 @@ object Denotations {
621621 throw ex
622622 case _ => Signature .NotAMethod
623623
624+ private var myCurrentJavaSig : Signature = uninitialized
625+ private var myCurrentJavaSigRunId : RunId = NoRunId
626+ private var myCurrentScala2Sig : Signature = uninitialized
627+ private var myCurrentScala2SigRunId : RunId = NoRunId
628+ private var myCurrentSig : Signature = uninitialized
629+ private var myCurrentSigRunId : RunId = NoRunId
630+
631+ def currentSignature (sourceLanguage : SourceLanguage )(using Context ): Signature = sourceLanguage match
632+ case SourceLanguage .Java =>
633+ if myCurrentJavaSigRunId != ctx.runId then
634+ myCurrentJavaSig = signature(sourceLanguage)
635+ myCurrentJavaSigRunId = ctx.runId
636+ myCurrentJavaSig
637+ case SourceLanguage .Scala2 =>
638+ if myCurrentScala2SigRunId != ctx.runId then
639+ myCurrentScala2Sig = signature(sourceLanguage)
640+ myCurrentScala2SigRunId = ctx.runId
641+ myCurrentScala2Sig
642+ case SourceLanguage .Scala3 =>
643+ if myCurrentSigRunId != ctx.runId then
644+ myCurrentSig = signature(sourceLanguage)
645+ myCurrentSigRunId = ctx.runId
646+ myCurrentSig
647+
624648 def derivedSingleDenotation (symbol : Symbol , info : Type , pre : Type = this .prefix, isRefinedMethod : Boolean = this .isRefinedMethod)(using Context ): SingleDenotation =
625649 if ((symbol eq this .symbol) && (info eq this .info) && (pre eq this .prefix) && (isRefinedMethod == this .isRefinedMethod)) this
626650 else newLikeThis(symbol, info, pre, isRefinedMethod)
@@ -1023,8 +1047,8 @@ object Denotations {
10231047 val thisLanguage = SourceLanguage (symbol)
10241048 val otherLanguage = SourceLanguage (other.symbol)
10251049 val commonLanguage = SourceLanguage .commonLanguage(thisLanguage, otherLanguage)
1026- val sig = signature (commonLanguage)
1027- val otherSig = other.signature (commonLanguage)
1050+ val sig = currentSignature (commonLanguage)
1051+ val otherSig = other.currentSignature (commonLanguage)
10281052 sig.matchDegree(otherSig) match
10291053 case FullMatch =>
10301054 ! alwaysCompareTypes || info.matches(other.info)
0 commit comments