[K/N] Extract const val initializers to place of usage

This would make behaviour more consistent with jvm. There is still
a difference in behaviour about point where side effects happen.

^KT-52970
This commit is contained in:
Pavel Kunyavskiy
2022-07-11 16:39:13 +02:00
committed by Space
parent 6a8da8f9eb
commit 5cdda48487
15 changed files with 212 additions and 43 deletions
@@ -25251,6 +25251,18 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
public void testConstPropertyAccessor() throws Exception {
runTest("compiler/testData/codegen/box/properties/const/constPropertyAccessor.kt");
}
@Test
@TestMetadata("intermoduleInlineConst.kt")
public void testIntermoduleInlineConst() throws Exception {
runTest("compiler/testData/codegen/box/properties/const/intermoduleInlineConst.kt");
}
@Test
@TestMetadata("kt52970.kt")
public void testKt52970() throws Exception {
runTest("compiler/testData/codegen/box/properties/const/kt52970.kt");
}
}
@Nested
@@ -25245,6 +25245,18 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
public void testConstPropertyAccessor() throws Exception {
runTest("compiler/testData/codegen/box/properties/const/constPropertyAccessor.kt");
}
@Test
@TestMetadata("intermoduleInlineConst.kt")
public void testIntermoduleInlineConst() throws Exception {
runTest("compiler/testData/codegen/box/properties/const/intermoduleInlineConst.kt");
}
@Test
@TestMetadata("kt52970.kt")
public void testKt52970() throws Exception {
runTest("compiler/testData/codegen/box/properties/const/kt52970.kt");
}
}
@Nested
@@ -22532,6 +22532,16 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
public void testConstPropertyAccessor() throws Exception {
runTest("compiler/testData/codegen/box/properties/const/constPropertyAccessor.kt");
}
@TestMetadata("intermoduleInlineConst.kt")
public void testIntermoduleInlineConst() throws Exception {
runTest("compiler/testData/codegen/box/properties/const/intermoduleInlineConst.kt");
}
@TestMetadata("kt52970.kt")
public void testKt52970() throws Exception {
runTest("compiler/testData/codegen/box/properties/const/kt52970.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/properties/lateinit")