breandan
07/13/2017, 6:26 PMoperator fun <T> KProperty0<T>.getValue(thisRef: Any?, property: KProperty<*>) = get()
operator fun <T> KMutableProperty0<T>.setValue(thisRef: Any?, property: KProperty<*>, value: T) = set(value)
This would let me use bound callable references as a property "alias". This enables me to write:
var propertyAlias by property1::property2
Otherwise, in order to to get the same functionality, I would need to write a custom getter/setter:
var propertyAlias
get() = property1.property2
set(value) {
property1.property2 = value
}
I believe this is a common enough scenario to warrant a stdlib addition. Thank you.