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:
+1
@@ -33,6 +33,7 @@ fun local() {
|
||||
// Optimized all to direct accesses, with `$delegate` methods generating reflected references on demand:
|
||||
// 0 extends kotlin/jvm/internal/MutablePropertyReference[0-2]Impl
|
||||
// 0 private final( static)? Lkotlin/reflect/KMutableProperty[0-2]; [xyz]m?\$delegate
|
||||
// 2 private final( static)? LC; [xyz]m?\$receiver
|
||||
// 0 LOCALVARIABLE [xyz]m? Lkotlin/reflect/KMutableProperty[0-2];
|
||||
// 12 static get[XYZ]m?\$delegate
|
||||
|
||||
|
||||
Reference in New Issue
Block a user