[FIR] Save info that when was used as expression
This commit is contained in:
+5
@@ -499,6 +499,11 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/whenInference.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("whenWithWhenAsStatement.kt")
|
||||
public void testWhenWithWhenAsStatement() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/whenWithWhenAsStatement.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/fir/analysis-tests/testData/resolve/arguments")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
FILE: whenWithWhenAsStatement.kt
|
||||
public final fun test(value: R|kotlin/Int|): R|kotlin/Unit| {
|
||||
when (R|<local>/value|) {
|
||||
==($subj$, Int(0)) -> {
|
||||
}
|
||||
==($subj$, Int(1)) -> {
|
||||
when (R|<local>/value|) {
|
||||
==($subj$, Int(2)) -> {
|
||||
Boolean(false)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
fun test(value: Int) {
|
||||
when (value) {
|
||||
0 -> {}
|
||||
1 -> when (value) {
|
||||
2 -> false
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
@@ -590,6 +590,12 @@ public class FirDiagnosticTestGenerated extends AbstractFirDiagnosticTest {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/whenInference.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("whenWithWhenAsStatement.kt")
|
||||
public void testWhenWithWhenAsStatement() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/whenWithWhenAsStatement.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/fir/analysis-tests/testData/resolve/arguments")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
+6
@@ -593,6 +593,12 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/whenInference.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("whenWithWhenAsStatement.kt")
|
||||
public void testWhenWithWhenAsStatement() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/whenWithWhenAsStatement.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/fir/analysis-tests/testData/resolve/arguments")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
Reference in New Issue
Block a user