【发布时间】:2018-04-06 00:06:57
【问题描述】:
val what: Option[Any] = Some("dab")
what match{
case a : Some[Int] => "its int"
case b : Some[String] => "its string"
case None => "42"
}
这个结果给警告 警告:(41, 29) 无法访问的代码 案例 b : Some[string] => "它的字符串" 有人能解释一下这个警告吗
P.S:忽略类型擦除警告。 ^
【问题讨论】: