Join Slack
Powered by
In Kotlin, extension properties are evaluated lazi...
# getting-started
k
Kashismails
12/29/2024, 8:59 AM
In Kotlin, extension properties are evaluated lazily? (edited)
j
Joffrey
12/29/2024, 9:34 AM
Rather, every time they are called. They are computed properties. If you want them lazy (computes the first time and then cached) you have to use
by lazy {}
🤯 1
Joffrey
12/29/2024, 9:34 AM
https://pl.kotl.in/_zEewbMS0
d
Daniel Pitts
12/30/2024, 4:12 AM
I don't think you can mix delegates and extensions like that though.
j
Joffrey
12/30/2024, 9:36 AM
There is a playground link demonstrating it working, though. What do you mean?
d
Daniel Pitts
12/30/2024, 4:19 PM
Huh. You’re right. I don’t know why I thought that. Oh, I might have been confusing it with value class delegations
k
Kashismails
12/30/2024, 6:13 PM
Thanks
@Joffrey
🚀 🚀
Open in Slack
Previous
Next