New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pattern matcher's use of equals inhibits important warnings #7456
Comments
Imported From: https://issues.scala-lang.org/browse/SI-7456?orig=1 |
@paulp said: |
@paulp said: class A
final case class B(xs: List[A]) extends A
object Test {
def f(x: B) = x match { case B(x: A) => true ; case _ => false }
def g(x: B) = x match { case B((x: A) :: Nil) => true ; case _ => false }
def main(args: Array[String]): Unit = {
println(f(B(new A :: Nil)))
println(g(B(new A :: Nil)))
}
} Compiles with no warning in 2.9, but warns in 2.10. Which I should know, having written the warning.
|
@paulp said: |
as spec'ed. needs SIP |
How is Bippy, an A, ever going to be a List[A] ?
The text was updated successfully, but these errors were encountered: