is there a more elegant way of doing this? `if (!:...
# announcements
t
is there a more elegant way of doing this?
if (!::lateObj.isInitialized) lateObj = LateObj()
k
Why not make
lateObj
nullable then? 🤔
t
that's what i had before i tried to use lateInit, i had
lateObj = lateObj ?: LateObj()
i left it as that
but that doesn't look great either
k
I don’t think it gets simpler than this
Except if your use case fits well with
lazy
delegate
t
unfortunately not