@@ -621,6 +621,30 @@ object Denotations {
621
621
throw ex
622
622
case _ => Signature .NotAMethod
623
623
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
+
624
648
def derivedSingleDenotation (symbol : Symbol , info : Type , pre : Type = this .prefix, isRefinedMethod : Boolean = this .isRefinedMethod)(using Context ): SingleDenotation =
625
649
if ((symbol eq this .symbol) && (info eq this .info) && (pre eq this .prefix) && (isRefinedMethod == this .isRefinedMethod)) this
626
650
else newLikeThis(symbol, info, pre, isRefinedMethod)
@@ -1023,8 +1047,8 @@ object Denotations {
1023
1047
val thisLanguage = SourceLanguage (symbol)
1024
1048
val otherLanguage = SourceLanguage (other.symbol)
1025
1049
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)
1028
1052
sig.matchDegree(otherSig) match
1029
1053
case FullMatch =>
1030
1054
! alwaysCompareTypes || info.matches(other.info)
0 commit comments