From c2c2b450f1636f45551e8ec84a20252c5e06f927 Mon Sep 17 00:00:00 2001 From: Tagir Valeev Date: Thu, 14 Mar 2024 12:58:58 +0100 Subject: [PATCH] [kotlin-dfa] KtVariableDescriptor: use the module from outer session, rather than from symbol Fixes IDEA-349116 K2: IDE K2: "Unexpected class KtBuiltinsModule" from DFA GitOrigin-RevId: b5e1028359312506d57d4f0a420186d2766c0e36 --- .../k2/codeinsight/inspections/dfa/KtVariableDescriptor.kt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/plugins/kotlin/code-insight/inspections-k2/src/org/jetbrains/kotlin/idea/k2/codeinsight/inspections/dfa/KtVariableDescriptor.kt b/plugins/kotlin/code-insight/inspections-k2/src/org/jetbrains/kotlin/idea/k2/codeinsight/inspections/dfa/KtVariableDescriptor.kt index 8461e6971172..d9992711ca93 100644 --- a/plugins/kotlin/code-insight/inspections-k2/src/org/jetbrains/kotlin/idea/k2/codeinsight/inspections/dfa/KtVariableDescriptor.kt +++ b/plugins/kotlin/code-insight/inspections-k2/src/org/jetbrains/kotlin/idea/k2/codeinsight/inspections/dfa/KtVariableDescriptor.kt @@ -93,10 +93,7 @@ class KtVariableDescriptor( context(KtAnalysisSession) internal fun KtVariableLikeSymbol.variableDescriptor(): KtVariableDescriptor { - return KtVariableDescriptor( - this.getContainingModule(), this.createPointer(), this.returnType.toDfType(), - this.name.hashCode() - ) + return KtVariableDescriptor(useSiteModule, this.createPointer(), this.returnType.toDfType(), this.name.hashCode()) } private fun getVariablesChangedInNestedFunctions(parent: KtElement): Set =