I was surprised to see these results. Why is
Nothing not assignable from
Number? and also
Number not assignable from
Is this a special case because
Nothing is not assignable?
. Classes are NOT Types
Nothing is a
subtype of all values, but it IS NOT a subclass of all classes.
I’m a bit surprised this (
scala.runtime.Nothing$) even exists! Anyone know what it’s for?
In any case, as Luis indicates,
Nothing being a bottom type is a fact about the Scala type system that there’s no possibility of tricking Java reflection into understanding.
Dummy class which exist only to satisfy the JVM.”
Ah, “If such type appears in method signatures, it is erased to this one”, that makes sense, every type must erase to something. (And erasing to
Object instead would allow invalid calls from Java code.)