[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
This commit is contained in:
Tagir Valeev
2024-03-14 19:34:29 +00:00
committed by intellij-monorepo-bot
parent 83d69a1b92
commit c2c2b450f1
@@ -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<KtVariableDescriptor> =