Last active
October 13, 2016 14:14
-
-
Save atamborrino/e747afa09b971df98f6859e51b89da85 to your computer and use it in GitHub Desktop.
No warning =(
This file contains hidden or 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
| scala> sealed trait Test | |
| defined trait Test | |
| scala> case class Test1(a: Boolean) extends Test | |
| defined class Test1 | |
| scala> case class Test2(a: Boolean) extends Test | |
| defined class Test2 | |
| scala> :paste | |
| // Entering paste mode (ctrl-D to finish) | |
| def test(t: Test) = t match { | |
| case Test1(a) if a => "" | |
| case Test2(a) => "" | |
| } | |
| // Exiting paste mode, now interpreting. | |
| test: (t: Test)String | |
| // No warning on "match may not be exhaustive" =( |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment