spragg
09/10/2017, 11:35 PMlateinit var
is initialised without using it and catching the exception? or am I going to have to change it to a nullable ?karelpeeters
09/10/2017, 11:36 PMlateinit
is not really the right tool anymore, just use a nullable instead.spragg
09/10/2017, 11:40 PMsetUserVisibleHint
but that is getting triggered before onCreateView
. Thanks for the replyrusshwolf
09/11/2017, 12:31 AMlateinit
for this, especially in your case because you're initializing in a somewhat unusual location. But see also https://youtrack.jetbrains.com/issue/KT-9327 if you do want the ability to check initialization of lateinit
properties.Dalinar
09/11/2017, 12:55 AMthis@lambda
. You can still work around it but it's a bit "ugly" - I really needed often in my JS code but in regular JVM Kotlin I also run into it once in a while