[JVM_IR] Optimize properties delegated to const val
We can omit `get` call to delegated property and inline constant value directly. If we are not going to do that, we can get a runtime exception because all usages of const property will be inlined and the property itself will be dropped. #KT-63567 Fixed #KT-63580 Fixed
This commit is contained in:
+6
@@ -12550,6 +12550,12 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/delegateForExtPropertyInClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("delegateToConstVal.kt")
|
||||
public void testDelegateToConstVal() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/delegateToConstVal.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("delegateToConstructorParameter.kt")
|
||||
public void testDelegateToConstructorParameter() throws Exception {
|
||||
|
||||
+6
@@ -12844,6 +12844,12 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/delegateForExtPropertyInClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("delegateToConstVal.kt")
|
||||
public void testDelegateToConstVal() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/delegateToConstVal.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("delegateToConstructorParameter.kt")
|
||||
public void testDelegateToConstructorParameter() throws Exception {
|
||||
|
||||
+6
@@ -12256,6 +12256,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/delegateForExtPropertyInClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("delegateToConstVal.kt")
|
||||
public void testDelegateToConstVal() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/delegateToConstVal.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("delegateToConstructorParameter.kt")
|
||||
public void testDelegateToConstructorParameter() throws Exception {
|
||||
|
||||
+6
@@ -12551,6 +12551,12 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/delegateForExtPropertyInClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("delegateToConstVal.kt")
|
||||
public void testDelegateToConstVal() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/delegateToConstVal.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("delegateToConstructorParameter.kt")
|
||||
public void testDelegateToConstructorParameter() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user