Is there an easy way to access a backing property ...
# announcements
a
Is there an easy way to access a backing property delegate? For example, if I have:
Copy code
class C {
var prop: Type by MyDelegate()
}
and want to call a method on
MyDelegate
, I can’t, only when I declare it like this can I access it:
Copy code
class C {
val propDelegate = MyDelegate()
var prop: Type by propDelegate
}
Ideally I’d like to access it as it’s declared in the first example, but to the best of my knowledge it’s not possible.