https://kotlinlang.org logo
Title
m

mingkangpan

07/07/2018, 4:28 PM
not really, actually I wanted to use the ::variable.isInitialized from kotlin, which I cant
k

karelpeeters

07/07/2018, 5:07 PM
Why do you want that? Just make it a nullable property then.
m

mingkangpan

07/07/2018, 5:22 PM
yeah, I did that now, but I would just find it more beautiful if it doesn't have to be null
k

karelpeeters

07/07/2018, 5:24 PM
If you're going to check whether it's null just make it nullable, that's what "null safety" means.
m

mingkangpan

07/07/2018, 5:25 PM
but the thing is, it cant be null, it is designed as a lateinit
k

karelpeeters

07/07/2018, 5:28 PM
At the point you're checking it itcan be null, right?
m

mingkangpan

07/07/2018, 5:28 PM
yeah, the first time, but then I dont want to have
?
or
!!
all the time