maciekjanusz
05/19/2017, 10:15 AMlateinit var a: String
makes it possible to have non-nullable type and yet allow for this edge case of it being null until properly assigned value AFTER constructionlouiscad
05/19/2017, 11:58 AMvar a = 0
can work too, avoiding autoboxingmaciekjanusz
05/19/2017, 12:04 PMlateinit
, you cannot use lateinit
on properties with initializerlateinit
with primitives alsolouiscad
05/19/2017, 12:13 PMlateinit
would be pointless if first init is not late, but in the initializer instead 😉