Fix DataFlowValue creation for Transient/Script receivers

This commit is contained in:
Denis Zharkov
2015-08-27 16:05:54 +03:00
parent b471767e03
commit 9f8f0e9d37
@@ -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);