@nanodeath
In some cases, they overlap. Sometimes they don’t. I still need the property to be optional, because it’s completely okay if it’s null. But once it’s set to value, it shouldn’t be set to null again. If the property had to have a value every time I access it, then I could use lateinit. In my case, I can’t.
You cannot assign an optional long type to null safe type just like var cannot be assigned to val. Also, if you have a optional property you can safely use it without worrying about NPE, thats what null safety is designed for. Would you not want to do something like this?
var myProperty: Long? = Long.MIN_VALUE
get() = myProperty
set(newValue) {
field = newValue?.toLong()
}