Can I ask why there is a `Nothing` type and what t...
# random
a
Can I ask why there is a
Nothing
type and what the use case is
Nothing is parrent subtype of all other types, if Nothing is return type it means “this function will never return”, for exampole always throws exception, this make
TODO()
function so useful
p
@gildor You wrote "Nothing is parrent type of all other types" but I think it's the other way around. Nothing is like a bottom element in the type system and
Any?
is a parent of all other types
g
Yes, sorry, of course. It’s subtype of all other types
r

https://youtu.be/Uizh2WlJtnk?t=11m38sâ–ľ

11:38 if you’re on mobile
a
also,
Nothing?
is the type of the null literal, which is why it can be assigned to any nullable l-value