From d9e13e5736b4c0c14305f0a3e3a4bbfb188c65c9 Mon Sep 17 00:00:00 2001 From: noti0na1 Date: Wed, 18 Sep 2024 15:38:33 +0200 Subject: [PATCH] Revert cache for signature in denot --- .../dotty/tools/dotc/core/Denotations.scala | 28 ++----------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/core/Denotations.scala b/compiler/src/dotty/tools/dotc/core/Denotations.scala index 5f58d3a6bf08..2418aba1978b 100644 --- a/compiler/src/dotty/tools/dotc/core/Denotations.scala +++ b/compiler/src/dotty/tools/dotc/core/Denotations.scala @@ -626,30 +626,6 @@ object Denotations { throw ex case _ => Signature.NotAMethod - private var myCurrentJavaSig: Signature = uninitialized - private var myCurrentJavaSigRunId: RunId = NoRunId - private var myCurrentScala2Sig: Signature = uninitialized - private var myCurrentScala2SigRunId: RunId = NoRunId - private var myCurrentSig: Signature = uninitialized - private var myCurrentSigRunId: RunId = NoRunId - - def currentSignature(sourceLanguage: SourceLanguage)(using Context): Signature = sourceLanguage match - case SourceLanguage.Java => - if myCurrentJavaSigRunId != ctx.runId then - myCurrentJavaSig = signature(sourceLanguage) - myCurrentJavaSigRunId = ctx.runId - myCurrentJavaSig - case SourceLanguage.Scala2 => - if myCurrentScala2SigRunId != ctx.runId then - myCurrentScala2Sig = signature(sourceLanguage) - myCurrentScala2SigRunId = ctx.runId - myCurrentScala2Sig - case SourceLanguage.Scala3 => - if myCurrentSigRunId != ctx.runId then - myCurrentSig = signature(sourceLanguage) - myCurrentSigRunId = ctx.runId - myCurrentSig - def derivedSingleDenotation(symbol: Symbol, info: Type, pre: Type = this.prefix, isRefinedMethod: Boolean = this.isRefinedMethod)(using Context): SingleDenotation = if ((symbol eq this.symbol) && (info eq this.info) && (pre eq this.prefix) && (isRefinedMethod == this.isRefinedMethod)) this else newLikeThis(symbol, info, pre, isRefinedMethod) @@ -1057,8 +1033,8 @@ object Denotations { val thisLanguage = SourceLanguage(symbol) val otherLanguage = SourceLanguage(other.symbol) val commonLanguage = SourceLanguage.commonLanguage(thisLanguage, otherLanguage) - val sig = currentSignature(commonLanguage) - val otherSig = other.currentSignature(commonLanguage) + val sig = signature(commonLanguage) + val otherSig = other.signature(commonLanguage) sig.matchDegree(otherSig) match case FullMatch => !alwaysCompareTypes || info.matches(other.info)