We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Scala 2.11.7 doesn't warn me that the match may not be exhaustive on the following code snippet:
class Foo { def foo = { abstract sealed class Animal case class Goat(age: Int) extends Animal case class Horse(age: Int) extends Animal val x: Animal = Goat(1) x match { case Goat(_) ⇒ println("a goat") } } }
When I move the sealed class hierarchy outside the foo function, it warns me correctly.
class Foo { abstract sealed class Animal case class Goat(age: Int) extends Animal case class Horse(age: Int) extends Animal def foo = { val x: Animal = Goat(1) x match { case Goat(_) ⇒ println("a goat") } } }
Foo.scala:11: match may not be exhaustive [warn] It would fail on the following input: Horse(_) [warn] x match { [warn] ^ [warn] one warning found
The text was updated successfully, but these errors were encountered:
Imported From: https://issues.scala-lang.org/browse/SI-9573?orig=1 Reporter: Tomáš Dvořák (dvtomas) Affected Versions: 2.11.7
Sorry, something went wrong.
No branches or pull requests
Scala 2.11.7 doesn't warn me that the match may not be exhaustive on the following code snippet:
When I move the sealed class hierarchy outside the foo function, it warns me correctly.
Foo.scala:11: match may not be exhaustive
[warn] It would fail on the following input: Horse(_)
[warn] x match {
[warn] ^
[warn] one warning found
The text was updated successfully, but these errors were encountered: