I'm trying to implement a custom property delegate...
# announcements
b
I'm trying to implement a custom property delegate, but the compiler complains that it doesn't have a
getValue(receiver, property)
method. While that's true, I only have a
var value: Boolean
, I've looked into the source code for Lazy an it also only has a
var value: T
. Why can't I do it like this in my custom class?
y
Lazy.getValue()
is defined as an extension function
b
I see now, thanks
It would be convenient if there was an alternative syntax/signature for delegates where thisRef and property are redundant parameters (i.e. all delegates that are constructed in the
by
clause)
Or at least those parameters could then be passed to the constructor, if the delegate does require them