KT-10139: any if without else used in expression is an error

regardless of expected type: it can't be an expression, even of type Unit.

 #KT-10139 Fixed
This commit is contained in:
Dmitry Petrov
2015-11-27 16:06:11 +03:00
parent b0dab4c67a
commit 1a3a296827
8 changed files with 155 additions and 16 deletions
@@ -3282,6 +3282,12 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
doTest(fileName);
}
@TestMetadata("ifWhenWithoutElse.kt")
public void testIfWhenWithoutElse() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/controlStructures/ifWhenWithoutElse.kt");
doTest(fileName);
}
@TestMetadata("improperElseInExpression.kt")
public void testImproperElseInExpression() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/controlStructures/improperElseInExpression.kt");