d988853c11
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)
24 lines
326 B
Kotlin
Vendored
24 lines
326 B
Kotlin
Vendored
// WITH_RUNTIME
|
|
val String.foo: String
|
|
get() = this
|
|
|
|
abstract class A {
|
|
abstract val x: String
|
|
|
|
val y by x::foo
|
|
}
|
|
|
|
var storage = "OK"
|
|
|
|
class B : A() {
|
|
override var x: String
|
|
get() = storage
|
|
set(value) { storage = value }
|
|
}
|
|
|
|
fun box(): String {
|
|
val b = B()
|
|
b.x = "fail"
|
|
return b.y
|
|
}
|