Has anybody thought about how using sentinel-value...
# language-proposals
g
Has anybody thought about how using sentinel-values could be a lot more type safe if we bent the rules around
Nothing
a little bit? Eg consider:
lazy.kt
, if
UNINITIALIZED_VALUE
could be written as
object UNINITIALIZED_VALUE: Nothing
, then
_value
becomes a
T
rather than an
Any
, and that means you get to drop a bunch of
SuppressWarnings
and casts.