small fixes after review
This commit is contained in:
+1
-2
@@ -817,9 +817,8 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor {
|
|||||||
assert operationSign.getReferencedNameElementType() == JetTokens.EXCLEXCL;
|
assert operationSign.getReferencedNameElementType() == JetTokens.EXCLEXCL;
|
||||||
|
|
||||||
Call call = createCallForSpecialConstruction(expression, Collections.singletonList(baseExpression));
|
Call call = createCallForSpecialConstruction(expression, Collections.singletonList(baseExpression));
|
||||||
ResolvedCall<FunctionDescriptor> resolvedCall = resolveSpecialConstructionAsCall(
|
resolveSpecialConstructionAsCall(
|
||||||
call, "ExclExcl", Collections.singletonList("baseExpr"), Collections.singletonList(true), context, null);
|
call, "ExclExcl", Collections.singletonList("baseExpr"), Collections.singletonList(true), context, null);
|
||||||
resolvedCall.getResultingDescriptor();
|
|
||||||
JetTypeInfo baseTypeInfo = BindingContextUtils.getRecordedTypeInfo(baseExpression, context.trace.getBindingContext());
|
JetTypeInfo baseTypeInfo = BindingContextUtils.getRecordedTypeInfo(baseExpression, context.trace.getBindingContext());
|
||||||
assert baseTypeInfo != null : "Base expression was not processed: " + expression;
|
assert baseTypeInfo != null : "Base expression was not processed: " + expression;
|
||||||
JetType baseType = baseTypeInfo.getType();
|
JetType baseType = baseTypeInfo.getType();
|
||||||
|
|||||||
+4
-2
@@ -122,7 +122,7 @@ public class ControlStructureTypingUtils {
|
|||||||
return function;
|
return function;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*package*/ static MutableDataFlowInfoForArguments createDataFlowInfoForArgumentsForCall(
|
/*package*/ static MutableDataFlowInfoForArguments createIndependentDataFlowInfoForArgumentsForCall(
|
||||||
final Map<ValueArgument, DataFlowInfo> dataFlowInfoForArgumentsMap
|
final Map<ValueArgument, DataFlowInfo> dataFlowInfoForArgumentsMap
|
||||||
) {
|
) {
|
||||||
return new MutableDataFlowInfoForArguments() {
|
return new MutableDataFlowInfoForArguments() {
|
||||||
@@ -135,6 +135,7 @@ public class ControlStructureTypingUtils {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateInfo(@NotNull ValueArgument valueArgument, @NotNull DataFlowInfo dataFlowInfo) {
|
public void updateInfo(@NotNull ValueArgument valueArgument, @NotNull DataFlowInfo dataFlowInfo) {
|
||||||
|
//todo
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@@ -146,6 +147,7 @@ public class ControlStructureTypingUtils {
|
|||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public DataFlowInfo getResultInfo() {
|
public DataFlowInfo getResultInfo() {
|
||||||
|
//todo merge and use
|
||||||
return initialDataFlowInfo;
|
return initialDataFlowInfo;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -159,7 +161,7 @@ public class ControlStructureTypingUtils {
|
|||||||
Map<ValueArgument, DataFlowInfo> dataFlowInfoForArgumentsMap = Maps.newHashMap();
|
Map<ValueArgument, DataFlowInfo> dataFlowInfoForArgumentsMap = Maps.newHashMap();
|
||||||
dataFlowInfoForArgumentsMap.put(callForIf.getValueArguments().get(0), thenInfo);
|
dataFlowInfoForArgumentsMap.put(callForIf.getValueArguments().get(0), thenInfo);
|
||||||
dataFlowInfoForArgumentsMap.put(callForIf.getValueArguments().get(1), elseInfo);
|
dataFlowInfoForArgumentsMap.put(callForIf.getValueArguments().get(1), elseInfo);
|
||||||
return createDataFlowInfoForArgumentsForCall(dataFlowInfoForArgumentsMap);
|
return createIndependentDataFlowInfoForArgumentsForCall(dataFlowInfoForArgumentsMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*package*/ static Call createCallForSpecialConstruction(
|
/*package*/ static Call createCallForSpecialConstruction(
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ fun test(a: A, b: B, c: C) {
|
|||||||
val d: C = id(a)
|
val d: C = id(a)
|
||||||
val e: Any = id(a)
|
val e: Any = id(a)
|
||||||
val f = id(a)
|
val f = id(a)
|
||||||
|
f: A
|
||||||
val g = two(a, b)
|
val g = two(a, b)
|
||||||
g: B
|
g: B
|
||||||
g: A
|
g: A
|
||||||
|
|||||||
Reference in New Issue
Block a user