我的代码如下为什么我的模式匹配集合在Scala中失败?
val hash = new HashMap[String, List[Any]]
hash.put("test", List(1, true, 3))
val result = hash.get("test")
result match {
case List(Int, Boolean, Int) => println("found")
case _ => println("not found")
}
我希望“发现”来进行打印,但“未找到”被打印出来。我试图在任何具有Int,Boolean,Int三种元素的列表上匹配