当我使用 Scala REPL (Scala 2.9.1) 玩了一下时,我看到了 isInstanceOf 方法的惊人结果:
scala> val l = List[Int](1, 2, 3)
l: List[Int] = List(1, 2, 3)
scala> l.isInstanceOf[List[Int]]
warning: there were 1 unchecked warnings; re-run with -unchecked for details
res3: Boolean = true
scala> l.isInstanceOf[List[String]]
warning: there were 1 unchecked warnings; re-run with -unchecked for details
res4: Boolean = true
scala> l.isInstanceOf[List[Boolean]]
warning: there were 1 unchecked warnings; re-run with -unchecked for details
res5: Boolean = true
谁能解释最后两个结果?