analyze incomplete 'in' expression
This commit is contained in:
+5
-2
@@ -1075,9 +1075,12 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor {
|
|||||||
@Nullable JetExpression right,
|
@Nullable JetExpression right,
|
||||||
@NotNull ExpressionTypingContext context
|
@NotNull ExpressionTypingContext context
|
||||||
) {
|
) {
|
||||||
if (right == null) return JetTypeInfo.create(null, context.dataFlowInfo);
|
|
||||||
|
|
||||||
ExpressionTypingContext contextWithNoExpectedType = context.replaceExpectedType(NO_EXPECTED_TYPE);
|
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();
|
DataFlowInfo dataFlowInfo = facade.getTypeInfo(right, contextWithNoExpectedType).getDataFlowInfo();
|
||||||
|
|
||||||
ExpressionReceiver receiver = safeGetExpressionReceiver(facade, right, contextWithNoExpectedType);
|
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");
|
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")
|
@TestMetadata("incompleteAssignment.kt")
|
||||||
public void testIncompleteAssignment() throws Exception {
|
public void testIncompleteAssignment() throws Exception {
|
||||||
doTest("compiler/testData/diagnostics/tests/incompleteCode/incompleteAssignment.kt");
|
doTest("compiler/testData/diagnostics/tests/incompleteCode/incompleteAssignment.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user