small fixes after review

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