Add FIR test for KT-35565
This commit is contained in:
committed by
TeamCityServer
parent
5deb96f679
commit
1fe7a1ebb3
+6
@@ -4102,6 +4102,12 @@ public class DiagnosisCompilerFirTestdataTestGenerated extends AbstractDiagnosis
|
|||||||
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/enumValuesDeserialized.kt");
|
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/enumValuesDeserialized.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("errorsInUnreachable.kt")
|
||||||
|
public void testErrorsInUnreachable() throws Exception {
|
||||||
|
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/errorsInUnreachable.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("exception.kt")
|
@TestMetadata("exception.kt")
|
||||||
public void testException() throws Exception {
|
public void testException() throws Exception {
|
||||||
|
|||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
FILE: errorsInUnreachable.kt
|
||||||
|
public final fun case(): R|kotlin/String| {
|
||||||
|
lval x0: R|kotlin/Boolean| = Boolean(false)
|
||||||
|
lval x1: R|kotlin/String|
|
||||||
|
lval x: R|kotlin/Boolean|
|
||||||
|
try {
|
||||||
|
R|<local>/x0| = throw R|java/lang/Exception.Exception|() || Boolean(true)
|
||||||
|
R|<local>/x|.R|kotlin/Boolean.not|()
|
||||||
|
lval a: R|kotlin/Int| = R|<local>/x1|.R|kotlin/text/toInt|()
|
||||||
|
}
|
||||||
|
catch (e: R|kotlin/Exception|) {
|
||||||
|
^case String(OK)
|
||||||
|
}
|
||||||
|
|
||||||
|
^case String(NOK)
|
||||||
|
}
|
||||||
+13
@@ -0,0 +1,13 @@
|
|||||||
|
fun case(): String {
|
||||||
|
val x0 = false
|
||||||
|
val x1: String
|
||||||
|
val x: Boolean
|
||||||
|
try {
|
||||||
|
<!VAL_REASSIGNMENT!>x0<!> = (throw Exception()) || true //VAL_REASSIGNMENT should be
|
||||||
|
!<!UNINITIALIZED_VARIABLE!>x<!> //ok, unreachable code UNINITIALIZED_VARIABLE should be
|
||||||
|
val a: Int = <!UNINITIALIZED_VARIABLE!>x1<!>.toInt() //ok, unreachable code UNINITIALIZED_VARIABLE should be
|
||||||
|
} catch (e: Exception) {
|
||||||
|
return "OK"
|
||||||
|
}
|
||||||
|
return "NOK"
|
||||||
|
}
|
||||||
+6
@@ -4102,6 +4102,12 @@ public class FirDiagnosticTestGenerated extends AbstractFirDiagnosticTest {
|
|||||||
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/enumValuesDeserialized.kt");
|
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/enumValuesDeserialized.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("errorsInUnreachable.kt")
|
||||||
|
public void testErrorsInUnreachable() throws Exception {
|
||||||
|
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/errorsInUnreachable.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("exception.kt")
|
@TestMetadata("exception.kt")
|
||||||
public void testException() throws Exception {
|
public void testException() throws Exception {
|
||||||
|
|||||||
+6
@@ -4102,6 +4102,12 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
|
|||||||
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/enumValuesDeserialized.kt");
|
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/enumValuesDeserialized.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("errorsInUnreachable.kt")
|
||||||
|
public void testErrorsInUnreachable() throws Exception {
|
||||||
|
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/errorsInUnreachable.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("exception.kt")
|
@TestMetadata("exception.kt")
|
||||||
public void testException() throws Exception {
|
public void testException() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user