From f8adce8b9682ab446961cd0da61000daca9dcb10 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Thu, 4 Mar 2021 11:50:52 +0300 Subject: [PATCH] [FIR] Cleanup data flow analysis of safe calls --- .../kotlin/fir/resolve/dfa/FirDataFlowAnalyzer.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/FirDataFlowAnalyzer.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/FirDataFlowAnalyzer.kt index 3e189f5dfed..2a850c269be 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/FirDataFlowAnalyzer.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/FirDataFlowAnalyzer.kt @@ -792,17 +792,17 @@ abstract class FirDataFlowAnalyzer( fun exitSafeCall(safeCall: FirSafeCallExpression) { val node = graphBuilder.exitSafeCall().mergeIncomingFlow() - val previousFlow = node.previousFlow + val flow = node.flow - val variable = variableStorage.getOrCreateVariable(previousFlow, safeCall) + val variable = variableStorage.getOrCreateVariable(flow, safeCall) val receiverVariable = when (variable) { // There is some bug with invokes. See KT-36014 is RealVariable -> variable.explicitReceiverVariable ?: return - is SyntheticVariable -> variableStorage.getOrCreateVariable(previousFlow, safeCall.receiver) + is SyntheticVariable -> variableStorage.getOrCreateVariable(flow, safeCall.receiver) } - logicSystem.addImplication(node.flow, (variable notEq null) implies (receiverVariable notEq null)) + logicSystem.addImplication(flow, (variable notEq null) implies (receiverVariable notEq null)) if (receiverVariable.isReal()) { - logicSystem.addImplication(node.flow, (variable notEq null) implies (receiverVariable typeEq any)) + logicSystem.addImplication(flow, (variable notEq null) implies (receiverVariable typeEq any)) } }