Receiver refactoring in DataFlowValueFactory

This commit is contained in:
Mikhail Glukhikh
2015-11-17 10:39:41 +03:00
parent e56b898a53
commit f1034dbf19
3 changed files with 8 additions and 9 deletions
@@ -104,7 +104,7 @@ public class DataFlowValueFactory {
}
@NotNull
public static DataFlowValue createDataFlowValue(@NotNull ThisReceiver receiver) {
public static DataFlowValue createDataFlowValueForStableReceiver(@NotNull ReceiverValue receiver) {
KotlinType type = receiver.getType();
return new DataFlowValue(receiver, type, STABLE_VALUE, getImmanentNullability(type));
}
@@ -124,12 +124,11 @@ public class DataFlowValueFactory {
@NotNull BindingContext bindingContext,
@NotNull DeclarationDescriptor containingDeclarationOrModule
) {
if (receiverValue instanceof TransientReceiver || receiverValue instanceof ScriptReceiver) {
KotlinType type = receiverValue.getType();
return new DataFlowValue(receiverValue, type, STABLE_VALUE, getImmanentNullability(type));
}
else if (receiverValue instanceof ClassReceiver || receiverValue instanceof ExtensionReceiver) {
return createDataFlowValue((ThisReceiver) receiverValue);
if (receiverValue instanceof TransientReceiver ||
receiverValue instanceof ScriptReceiver ||
receiverValue instanceof ClassReceiver ||
receiverValue instanceof ExtensionReceiver) {
return createDataFlowValueForStableReceiver(receiverValue);
}
else if (receiverValue instanceof ExpressionReceiver) {
return createDataFlowValue(((ExpressionReceiver) receiverValue).getExpression(),