How can a object be child of both AnyVal and AnyRef in Scala3.x

84 Views Asked by At

Why does all of these return true, while for AnyVal returns error on scala 2.x

class Demo
val d = new Demo
d.isInstanceOf[Any]

-> true

d.isInstanceOf[AnyRef]

-> true

d.isInstanceOf[AnyVal]

-> true

0

There are 0 best solutions below