<https://discuss.kotlinlang.org/t/datatype-for-onl...
# forum
r
"DataType" for only initial null value For various reasons I work with classes which contain variables for objects which only can be null if not initialized. I would like this as an option to declare. class Hull { var nodeHullOptions: List? = null private set } I would suggest a third option: Do not allow to assign null again, maybe mark it with an additional exclamation mark: class Hull { var nodeHullOptions: List?! = null private set } The compiler can then do all the same checks it would do...