elizarov
03/06/2017, 7:20 AMnull
in Kotlin. It works perfectly for end apps. The only inconvenience is when you are writing this kind of low-level utility library like lazy
or kotlinx.coroutines
deferreds and channels and you want to be efficient (use a single field) and support both null
and some other implementation-specific tags like the UNINITALIZED_VALUE
. That is really the use-case for union types. It does not fit into Nothing
from the type-system point of view.