analyze incomplete 'in' expression

This commit is contained in:
Svetlana Isakova
2013-09-01 19:58:18 +04:00
parent da07d60ad6
commit 0084b68176
3 changed files with 15 additions and 2 deletions
@@ -1075,9 +1075,12 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor {
@Nullable JetExpression right,
@NotNull ExpressionTypingContext context
) {
if (right == null) return JetTypeInfo.create(null, context.dataFlowInfo);
ExpressionTypingContext contextWithNoExpectedType = context.replaceExpectedType(NO_EXPECTED_TYPE);
if (right == null) {
if (left != null) facade.getTypeInfo(left, contextWithNoExpectedType);
return JetTypeInfo.create(null, context.dataFlowInfo);
}
DataFlowInfo dataFlowInfo = facade.getTypeInfo(right, contextWithNoExpectedType).getDataFlowInfo();
ExpressionReceiver receiver = safeGetExpressionReceiver(facade, right, contextWithNoExpectedType);
@@ -0,0 +1,5 @@
package l
fun test(a: Int) {
if (a in<!SYNTAX!><!> ) {} //a is not unresolved
}
@@ -2582,6 +2582,11 @@ public class JetDiagnosticsTestGenerated extends AbstractDiagnosticsTestWithEage
doTest("compiler/testData/diagnostics/tests/incompleteCode/checkNothingIsSubtype.kt");
}
@TestMetadata("inExpr.kt")
public void testInExpr() throws Exception {
doTest("compiler/testData/diagnostics/tests/incompleteCode/inExpr.kt");
}
@TestMetadata("incompleteAssignment.kt")
public void testIncompleteAssignment() throws Exception {
doTest("compiler/testData/diagnostics/tests/incompleteCode/incompleteAssignment.kt");