Added a test on lateinit var inside a local class
This commit is contained in:
Generated
+5
@@ -18966,6 +18966,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
runTest("compiler/testData/codegen/box/properties/lateinit/exceptionGetter.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("localClass.kt")
|
||||
public void testLocalClass() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/properties/lateinit/localClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("nameClash.kt")
|
||||
public void testNameClash() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/properties/lateinit/nameClash.kt");
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
// WITH_RUNTIME
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// IGNORE_BACKEND: JVM_IR, JS_IR
|
||||
|
||||
import kotlin.UninitializedPropertyAccessException
|
||||
|
||||
fun box(): String {
|
||||
val o = object {
|
||||
lateinit var x: Any
|
||||
}
|
||||
try {
|
||||
if (o.x == null) return "fail 1"
|
||||
return "fail 2"
|
||||
} catch (t: UninitializedPropertyAccessException) {
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
+5
@@ -20527,6 +20527,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/properties/lateinit/exceptionGetter.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("localClass.kt")
|
||||
public void testLocalClass() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/properties/lateinit/localClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("nameClash.kt")
|
||||
public void testNameClash() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/properties/lateinit/nameClash.kt");
|
||||
|
||||
+5
@@ -20527,6 +20527,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/properties/lateinit/exceptionGetter.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("localClass.kt")
|
||||
public void testLocalClass() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/properties/lateinit/localClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("nameClash.kt")
|
||||
public void testNameClash() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/properties/lateinit/nameClash.kt");
|
||||
|
||||
+5
@@ -18966,6 +18966,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/properties/lateinit/exceptionGetter.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("localClass.kt")
|
||||
public void testLocalClass() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/properties/lateinit/localClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("nameClash.kt")
|
||||
public void testNameClash() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/properties/lateinit/nameClash.kt");
|
||||
|
||||
Generated
+5
@@ -15872,6 +15872,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/properties/lateinit/exceptionGetter.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("localClass.kt")
|
||||
public void testLocalClass() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/properties/lateinit/localClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("nameClash.kt")
|
||||
public void testNameClash() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/properties/lateinit/nameClash.kt");
|
||||
|
||||
+5
@@ -15977,6 +15977,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/properties/lateinit/exceptionGetter.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("localClass.kt")
|
||||
public void testLocalClass() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/properties/lateinit/localClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("nameClash.kt")
|
||||
public void testNameClash() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/properties/lateinit/nameClash.kt");
|
||||
|
||||
Reference in New Issue
Block a user