Add test for smart cast on a value bound to when subject variable

E.g.:
  when (val y = x?.foo()) {
    null -> ...
    else -> ... // 'x' is also non-null here
  }
This commit is contained in:
Dmitry Petrov
2017-10-23 08:58:51 +03:00
parent 0a0bc67e8a
commit 5f0c9490bb
4 changed files with 25 additions and 0 deletions
@@ -22484,6 +22484,12 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
doTest(fileName);
}
@TestMetadata("smartCastOnValueBoundToSubjectVariable.kt")
public void testSmartCastOnValueBoundToSubjectVariable() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/when/withSubjectVariable/smartCastOnValueBoundToSubjectVariable.kt");
doTest(fileName);
}
@TestMetadata("smartCastsOnSubjectVariable.kt")
public void testSmartCastsOnSubjectVariable() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/when/withSubjectVariable/smartCastsOnSubjectVariable.kt");