JVM_IR: optimize out redundant delegated property receiver fields
Now this:
class C {
val x = something
val y by x::property
}
is *exactly* the same as this:
class C {
val x = something
val y get() = x.property
}
(plus a `getY$delegate` method)
This commit is contained in:
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java
Generated
+10
@@ -9551,6 +9551,16 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/delegateToAnotherMutable.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("delegateToAnotherWithSideEffects.kt")
|
||||
public void testDelegateToAnotherWithSideEffects() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/delegateToAnotherWithSideEffects.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("delegateToOpenProperty.kt")
|
||||
public void testDelegateToOpenProperty() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/delegateToOpenProperty.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("delegateWithPrivateSet.kt")
|
||||
public void testDelegateWithPrivateSet() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/delegateWithPrivateSet.kt");
|
||||
|
||||
Generated
+10
@@ -8957,6 +8957,16 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/delegateToAnotherMutable.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("delegateToAnotherWithSideEffects.kt")
|
||||
public void testDelegateToAnotherWithSideEffects() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/delegateToAnotherWithSideEffects.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("delegateToOpenProperty.kt")
|
||||
public void testDelegateToOpenProperty() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/delegateToOpenProperty.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("delegateWithPrivateSet.kt")
|
||||
public void testDelegateWithPrivateSet() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/delegateWithPrivateSet.kt");
|
||||
|
||||
Generated
+10
@@ -8957,6 +8957,16 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/delegateToAnotherMutable.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("delegateToAnotherWithSideEffects.kt")
|
||||
public void testDelegateToAnotherWithSideEffects() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/delegateToAnotherWithSideEffects.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("delegateToOpenProperty.kt")
|
||||
public void testDelegateToOpenProperty() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/delegateToOpenProperty.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("delegateWithPrivateSet.kt")
|
||||
public void testDelegateWithPrivateSet() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/delegatedProperty/delegateWithPrivateSet.kt");
|
||||
|
||||
Reference in New Issue
Block a user