Introduce a separate StackValue class for lateinit local vars
Local lateinit var differs in behavior from a simple local var, and logic that relies of 'instanceof Local' checks assuming that all instances of Local are simple local vars can produce faulty code (as in KT-23260, where a local lateinit var was not explicitly put on stack when passed as an argument to an inline function, thus causing null propagation). #KT-23260 Fixed Target versions 1.2.50
This commit is contained in:
+6
@@ -13812,6 +13812,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/properties/lateinit/local/capturedLocalLateinit.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt23260.kt")
|
||||
public void testKt23260() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/properties/lateinit/local/kt23260.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("localLateinit.kt")
|
||||
public void testLocalLateinit() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/properties/lateinit/local/localLateinit.kt");
|
||||
|
||||
Reference in New Issue
Block a user