You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
objectTestMatchextendsApp {
defgetValues:Object= {
valx=new java.util.Vector[Double]()
x.add(1.0)
x
}
valx= getValues
x match {
casel: java.util.Vector[_] =>
l.get(0) match {
cased: Double=> println(s"got first $d") // unreachable case warningcase _ => println("shrug")
}
}
x match {
casel: java.util.Vector[_] =>
l.get(0) match {
cased: Double=> println(s"got second $d") // no warning
}
}
}
Output
unreachable case warning on line indicated with comment
Expectation
Running the app shows that the case is used so I'd expect no warning.
The second match statement doesn't have a warning for case d: Double so why does the first?
I get the correct warnings if getValues is not returned as Object.
I don't think this is the same as other open unreachable case issues. It doesn't involve unions or nulls