Nothing is a special class in Kotlin. One use of
Nothing is as a return
type — this indicates that the function will never return normally.
Typically, this is because the function always throws an exception. The
function in standard Kotlin works this way, as does the
heyThisIsNotDoneYet() is set to return an
and there is no
return statement, this sample compiles and runs. The
reason is because Kotlin sees that
Nothing, and therefore
the entire rest of the
heyThisIsNotDoneYet() function after the
call is meaningless, as
NOTDONE() will never return.