Bottom type


#1

Does Kotlin have a bottom type (subtype of anything) like Scala? If not, I suggest to introduce it.

With a bottom type it is possible to define methods that are compatible with any return type, like this short cut to express “not implemented yet”:

def doIt(): Something = ???

Whereas ??? is an method of the type Nothing (Scala bottom type), which throws an exception at runtime.


#2

It's called Nothing in Kotlin as well.


#3

Cool!

Is it somewhere in the docs?


#4

http://jetbrains.github.io/kotlin/versions/snapshot/apidocs/kotlin/Nothing.html