Hi there, is there a reason not to have a type par...
# stdlib
u
Hi there, is there a reason not to have a type parameter for the delegate on a
KProperty
? if there was, one could write extension functions, depending on the delegate type. I.e.
Copy code
fun KProperty<*, BehaviorRelayDelegate>.subscribe(O: Observer)
and use it like
Copy code
val v : Int by BehaviorRelayDelegate(0)
::v.subscribe { Log("Value changed to $it" }
v = 2
val v1 = v
i
Property delegation is considered an implementation detail of a property, thus a statically reflected
KProperty
cannot expose that detail, i.e. the delegate type.