It is said that scala.Nothing and scala.Null are bottom classes and they extend every other AnyRef classes. consider the below snippet
class Test() {}
val test:Test = null
So for the statement to succeeded either Null should extend the custom class Test (i.e. Test is a super type of Null) or the type system should make exceptions of not throwing type mismatch error for scala.Null. How scala ensures that these two classes always extend any other AnyRef descendants classes in scala ?
NullandNothingare explicitly special-cased in the compiler AIUI - is that what you're asking? - lmm