From 666ca77666f366bc70551e51d48a7770cb0e323c Mon Sep 17 00:00:00 2001 From: Denis Zharkov Date: Mon, 6 Aug 2018 17:29:03 +0700 Subject: [PATCH] Fix incorrect optimization in ExpressionTypingServices Previously, it's been working because was almost always a different instance. After, the latter change with avoidance of storing trivial info there, newDataFlowInfo may accidentally become empty as context.dataFlowInfo. But we, obviously, should compare it with newContext.dataFlowInfo instead --- .../kotlin/types/expressions/ExpressionTypingServices.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ExpressionTypingServices.java b/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ExpressionTypingServices.java index 788642efaae..01f721c29d2 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ExpressionTypingServices.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ExpressionTypingServices.java @@ -297,7 +297,7 @@ public class ExpressionTypingServices { beforeJumpInfo = result.getJumpFlowInfo(); jumpOutPossible = result.getJumpOutPossible(); } - if (newDataFlowInfo != context.dataFlowInfo) { + if (newDataFlowInfo != newContext.dataFlowInfo) { newContext = newContext.replaceDataFlowInfo(newDataFlowInfo); // We take current data flow info if jump there is not possible }