Understanding of scala.Nothing type

Viewed 1544

According to the scala specification, scala.Nothing type - buttom for all types. Type "Nothing" exists but instance of Nothing does not exists.

How it works:

def ??? : Nothing = throw new NoImplementedError
def sys.error(message: String): Nothing = throw new RuntimeException()
def sys.exit(status: Int): Nothing = {...}

But in fact, all of mentioned methods return exception. Excepted def sys.exit Could you please clarify more about type Nothing. Any examples, explanations.

Thanks!

2 Answers
Related