任何人都知道为什么这些会产生未经检查的警告......
def anyMap(a: Any): Unit = a match {
case _: Map[Any, Any] =>
}
//warning: non-variable type argument Any in type pattern scala.collection.immutable.Map[Any,Any] (the underlying of Map[Any,Any]) is unchecked since it is eliminated by erasure
def intList(a: Any): Unit = a match {
case _: List[Int] =>
}
//warning: non-variable type argument Int in type pattern List[Int] (the underlying of List[Int]) is unchecked since it is eliminated by erasure
...但这不是吗?
def anyList(a: Any): Unit = a match {
case _: List[Any] =>
}
//[crickets]
大多只是好奇。谢谢