groostav
08/05/2016, 2:23 AMby
operator's dual.
class Delegate<THost, TProp>{
var value: TProp? = null
fun getValue(): TProp { return value; }
fun setValue(value: TProp) { this.value = value }
}
class SomeClass(){
val prop: Int by delegate { things(); }
}
I want to then write
val instance = SomeClass();
val delegate: Delegate<SomeClass, Int> = yb { instance.prop }
--though I think yb
would be a terrible name for this operator.