In property delegation right now the property name...
# language-proposals
m
In property delegation right now the property name is only accessible when
getValue()
was called. It would be great if we could access the property name at the creation binding time of the delegate. Something like this:
Copy code
operator fun delegateProperty(thisRef: Any?, property: KProperty*) { … }
Currently I have to pass the property name manually because it need to “register” the argument name and type way before the delegate’s
getValue()
is called.
d
You can use
provideDelegate
It called when property with delegate was declared https://kotlinlang.org/docs/reference/delegated-properties.html#providing-a-delegate-since-11
👆🏻 2
m
That’s amazing! How did I miss that for so long? 🤩 Thank you!
👍 2