2 years ago
#44569
Guru
How can a object be child of both AnyVal and AnyRef in Scala3.x
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
scala
scala-2.10
scala-3
0 Answers
Your Answer