Last active
August 29, 2015 14:20
-
-
Save overthink/e56f35159f6bc5751d34 to your computer and use it in GitHub Desktop.
Scala lost guarded exhaustiveness checks at 2.10.x... very annoying
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mark@mark-pc2:~/tmp/patterns$ cat Test.scala | |
sealed trait Foo | |
case object A extends Foo | |
case object B extends Foo | |
object Test { | |
def f(foo: Foo) { | |
foo match { | |
case A if true => | |
println("A") | |
case B => | |
println("B") | |
} | |
} | |
} | |
mark@mark-pc2:~/tmp/patterns$ ~/scala-2.8.0.final/bin/scalac ./Test.scala | |
./Test.scala:7: warning: match is not exhaustive! | |
missing combination A | |
foo match { | |
^ | |
one warning found | |
mark@mark-pc2:~/tmp/patterns$ ~/scala-2.9.3/bin/scalac ./Test.scala | |
./Test.scala:7: warning: match is not exhaustive! | |
missing combination A | |
foo match { | |
^ | |
one warning found | |
mark@mark-pc2:~/tmp/patterns$ ~/scala-2.10.5/bin/scalac ./Test.scala | |
mark@mark-pc2:~/tmp/patterns$ ~/scala-2.11.6/bin/scalac ./Test.scala | |
mark@mark-pc2:~/tmp/patterns$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment