Minor, add box test for unreachable uninitialized property

#KT-44496
This commit is contained in:
Alexander Udalov
2021-03-08 20:40:04 +01:00
parent 247efb220c
commit 5fc9f3bc17
9 changed files with 64 additions and 0 deletions
@@ -27512,6 +27512,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
runTest("compiler/testData/codegen/box/properties/typeInferredFromGetter.kt");
}
@Test
@TestMetadata("unreachableUninitializedProperty.kt")
public void testUnreachableUninitializedProperty() throws Exception {
runTest("compiler/testData/codegen/box/properties/unreachableUninitializedProperty.kt");
}
@Nested
@TestMetadata("compiler/testData/codegen/box/properties/const")
@TestDataPath("$PROJECT_ROOT")
@@ -0,0 +1,21 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: WASM
// WASM_MUTE_REASON: EXCEPTIONS_NOT_IMPLEMENTED
// WITH_RUNTIME
// KT-44496
class C {
val todo: String = TODO()
val uninitializedVal: String
var uninitializedVar: String
}
fun box(): String =
try {
C()
"Fail"
} catch (e: NotImplementedError) {
"OK"
}
@@ -27512,6 +27512,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/properties/typeInferredFromGetter.kt");
}
@Test
@TestMetadata("unreachableUninitializedProperty.kt")
public void testUnreachableUninitializedProperty() throws Exception {
runTest("compiler/testData/codegen/box/properties/unreachableUninitializedProperty.kt");
}
@Nested
@TestMetadata("compiler/testData/codegen/box/properties/const")
@TestDataPath("$PROJECT_ROOT")
@@ -27512,6 +27512,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/properties/typeInferredFromGetter.kt");
}
@Test
@TestMetadata("unreachableUninitializedProperty.kt")
public void testUnreachableUninitializedProperty() throws Exception {
runTest("compiler/testData/codegen/box/properties/unreachableUninitializedProperty.kt");
}
@Nested
@TestMetadata("compiler/testData/codegen/box/properties/const")
@TestDataPath("$PROJECT_ROOT")
@@ -23402,6 +23402,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/properties/typeInferredFromGetter.kt");
}
@TestMetadata("unreachableUninitializedProperty.kt")
public void testUnreachableUninitializedProperty() throws Exception {
runTest("compiler/testData/codegen/box/properties/unreachableUninitializedProperty.kt");
}
@TestMetadata("compiler/testData/codegen/box/properties/const")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -18645,6 +18645,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
runTest("compiler/testData/codegen/box/properties/typeInferredFromGetter.kt");
}
@TestMetadata("unreachableUninitializedProperty.kt")
public void testUnreachableUninitializedProperty() throws Exception {
runTest("compiler/testData/codegen/box/properties/unreachableUninitializedProperty.kt");
}
@TestMetadata("compiler/testData/codegen/box/properties/const")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -18102,6 +18102,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/properties/typeInferredFromGetter.kt");
}
@TestMetadata("unreachableUninitializedProperty.kt")
public void testUnreachableUninitializedProperty() throws Exception {
runTest("compiler/testData/codegen/box/properties/unreachableUninitializedProperty.kt");
}
@TestMetadata("compiler/testData/codegen/box/properties/const")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -18152,6 +18152,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/properties/typeInferredFromGetter.kt");
}
@TestMetadata("unreachableUninitializedProperty.kt")
public void testUnreachableUninitializedProperty() throws Exception {
runTest("compiler/testData/codegen/box/properties/unreachableUninitializedProperty.kt");
}
@TestMetadata("compiler/testData/codegen/box/properties/const")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -11624,6 +11624,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
runTest("compiler/testData/codegen/box/properties/typeInferredFromGetter.kt");
}
@TestMetadata("unreachableUninitializedProperty.kt")
public void testUnreachableUninitializedProperty() throws Exception {
runTest("compiler/testData/codegen/box/properties/unreachableUninitializedProperty.kt");
}
@TestMetadata("compiler/testData/codegen/box/properties/const")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)