https://kotlinlang.org logo
#announcements
Title
# announcements
r

redrield

07/30/2017, 5:03 AM
Returning it in getValue along with the proper value seems to be annoying because I can't destruct a Pair at the top level of the class
k

karelpeeters

07/30/2017, 2:23 PM
You can keep the delegate in a separate field in your class, like this:
Copy code
class MyClass {
    val delegate = myDelegate()
    val myField: Int by delegate
}
And then you can do whatever you want.
2 Views