Support empty if-statements
Type-check "if (...) ;" to Unit, report "implicit cast to Unit", propagate data flow info out of its condition #KT-2478 Fixed
This commit is contained in:
@@ -1565,6 +1565,11 @@ public class JetDiagnosticsTestGenerated extends AbstractDiagnosticsTestWithEage
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/diagnostics/tests/controlStructures"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("emptyIf.kt")
|
||||
public void testEmptyIf() throws Exception {
|
||||
doTest("compiler/testData/diagnostics/tests/controlStructures/emptyIf.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forLoopWithNullableRange.kt")
|
||||
public void testForLoopWithNullableRange() throws Exception {
|
||||
doTest("compiler/testData/diagnostics/tests/controlStructures/forLoopWithNullableRange.kt");
|
||||
@@ -1757,6 +1762,11 @@ public class JetDiagnosticsTestGenerated extends AbstractDiagnosticsTestWithEage
|
||||
doTest("compiler/testData/diagnostics/tests/dataFlow/CalleeExpression.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("EmptyIf.kt")
|
||||
public void testEmptyIf() throws Exception {
|
||||
doTest("compiler/testData/diagnostics/tests/dataFlow/EmptyIf.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("IsExpression.kt")
|
||||
public void testIsExpression() throws Exception {
|
||||
doTest("compiler/testData/diagnostics/tests/dataFlow/IsExpression.kt");
|
||||
@@ -3917,7 +3927,7 @@ public class JetDiagnosticsTestGenerated extends AbstractDiagnosticsTestWithEage
|
||||
public void testContains() throws Exception {
|
||||
doTest("compiler/testData/diagnostics/tests/inline/binaryExpressions/contains.kt");
|
||||
}
|
||||
|
||||
|
||||
@TestMetadata("mathOperations.kt")
|
||||
public void testMathOperations() throws Exception {
|
||||
doTest("compiler/testData/diagnostics/tests/inline/binaryExpressions/mathOperations.kt");
|
||||
|
||||
@@ -1427,6 +1427,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
doTest("compiler/testData/codegen/box/controlStructures/doWhileFib.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("emptyIf.kt")
|
||||
public void testEmptyIf() throws Exception {
|
||||
doTest("compiler/testData/codegen/box/controlStructures/emptyIf.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("finallyOnEmptyReturn.kt")
|
||||
public void testFinallyOnEmptyReturn() throws Exception {
|
||||
doTest("compiler/testData/codegen/box/controlStructures/finallyOnEmptyReturn.kt");
|
||||
|
||||
Reference in New Issue
Block a user