From 9f8f0e9d373c055db634e5e165b35e6581da9898 Mon Sep 17 00:00:00 2001 From: Denis Zharkov Date: Thu, 27 Aug 2015 16:05:54 +0300 Subject: [PATCH] Fix DataFlowValue creation for Transient/Script receivers --- .../kotlin/resolve/calls/smartcasts/DataFlowValueFactory.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/smartcasts/DataFlowValueFactory.java b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/smartcasts/DataFlowValueFactory.java index eabb3ca4c5d..cbdf0b7b84b 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/smartcasts/DataFlowValueFactory.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/smartcasts/DataFlowValueFactory.java @@ -118,8 +118,7 @@ public class DataFlowValueFactory { if (receiverValue instanceof TransientReceiver || receiverValue instanceof ScriptReceiver) { // SCRIPT: smartcasts data flow JetType type = receiverValue.getType(); - boolean nullable = type.isMarkedNullable() || TypeUtils.hasNullableSuperType(type); - return new DataFlowValue(receiverValue, type, nullable, false, Nullability.NOT_NULL); + return new DataFlowValue(receiverValue, type, true, false, getImmanentNullability(type)); } else if (receiverValue instanceof ClassReceiver || receiverValue instanceof ExtensionReceiver) { return createDataFlowValue((ThisReceiver) receiverValue);