JVM_IR: optimize delegation by property references
E.g. a statement like
var x by ::y
is semantically equivalent to
var x
get() = y
set(value) { y = value }
and thus does not need a full property reference object, or even a field
if the receiver is not bound.
#KT-39054 Fixed
#KT-47102 Fixed
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
// WITH_RUNTIME
|
||||
// IGNORE_BACKEND: JS
|
||||
class C(var x: String)
|
||||
|
||||
var x = "fail"
|
||||
var y by ::x
|
||||
var z by C("fail")::x
|
||||
|
||||
fun box(): String {
|
||||
y = "O"
|
||||
z = "K"
|
||||
return y + z
|
||||
}
|
||||
Reference in New Issue
Block a user