Get Delegate Property Name on Initialization
Hello,
when we use delegates, the setter and getter methods provide us with the name of the property that is get or set. Is it possible to get the name of the property during initialization as well?
Example
var gamma by Delegate(1.0f)
class Delegate(value: Float) {
operator fun getValue(thisRef: Any?, property: KProperty): Float{
return "$thisRef, thank you for delegating '${property.name}' to me!"
}
operator fun setValue(thisRef: Any?, property: KProperty, value: Float)...