LeoColman
02/20/2019, 2:39 PMlazy
that includes the receiver? So that I can do val Foo.bar by lazy { this.baz }
where this
is Foo
540grunkspin
02/20/2019, 2:41 PMstreetsofboston
02/20/2019, 2:43 PMclass MyLazyDelegate<T> {
// For class properties
operator fun getValue(receiver: Any, property: KProperty<*>): T {
TODO()
}
// For stack-frame/heap vals.
operator fun getValue(receiver: Nothing?, property: KProperty<*>): T {
TODO()
}
}
ilya.gorbunov
02/20/2019, 4:36 PMFoo
object being extended, you're gonna need some external storage for that.