@@ -626,6 +626,30 @@ object Denotations {
626
626
throw ex
627
627
case _ => Signature .NotAMethod
628
628
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
+
629
653
def derivedSingleDenotation (symbol : Symbol , info : Type , pre : Type = this .prefix, isRefinedMethod : Boolean = this .isRefinedMethod)(using Context ): SingleDenotation =
630
654
if ((symbol eq this .symbol) && (info eq this .info) && (pre eq this .prefix) && (isRefinedMethod == this .isRefinedMethod)) this
631
655
else newLikeThis(symbol, info, pre, isRefinedMethod)
@@ -1033,8 +1057,8 @@ object Denotations {
1033
1057
val thisLanguage = SourceLanguage (symbol)
1034
1058
val otherLanguage = SourceLanguage (other.symbol)
1035
1059
val commonLanguage = SourceLanguage .commonLanguage(thisLanguage, otherLanguage)
1036
- val sig = signature (commonLanguage)
1037
- val otherSig = other.signature (commonLanguage)
1060
+ val sig = currentSignature (commonLanguage)
1061
+ val otherSig = other.currentSignature (commonLanguage)
1038
1062
sig.matchDegree(otherSig) match
1039
1063
case FullMatch =>
1040
1064
! alwaysCompareTypes || info.matches(other.info)
0 commit comments