Can anyone tell me why I can’t write something lik...
# getting-started
r
Can anyone tell me why I can’t write something like this
Copy code
fun fatal(m: String): Nothing {
    with(TermColors()) {
        println(red(m))
        System.exit(1)
    }
}
s
Because exit returns
Unit
d
System.exit
does not return
Nothing
, only
exitProcess
does.
r
Thanks !