Resolve variable declaration in 'when' subject

This commit is contained in:
Dmitry Petrov
2017-10-20 12:21:17 +03:00
parent 84e49e5b57
commit 1eeafc2d0e
11 changed files with 162 additions and 5 deletions
@@ -22457,6 +22457,33 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
public void testWhenWithNothingAndLambdas() throws Exception {
runTest("compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.kt");
}
@TestMetadata("compiler/testData/diagnostics/tests/when/withSubjectVariable")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class WithSubjectVariable extends AbstractDiagnosticsTest {
public void testAllFilesPresentInWithSubjectVariable() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/tests/when/withSubjectVariable"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
}
@TestMetadata("invisibleOutsideOfWhen.kt")
public void testInvisibleOutsideOfWhen() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/when/withSubjectVariable/invisibleOutsideOfWhen.kt");
doTest(fileName);
}
@TestMetadata("shadowingOtherVariable.kt")
public void testShadowingOtherVariable() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/when/withSubjectVariable/shadowingOtherVariable.kt");
doTest(fileName);
}
@TestMetadata("unsupportedFeature.kt")
public void testUnsupportedFeature() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/when/withSubjectVariable/unsupportedFeature.kt");
doTest(fileName);
}
}
}
}