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

Viewed 58

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 Answers
Related