Created
October 17, 2013 04:51
-
-
Save zakki/7019336 to your computer and use it in GitHub Desktop.
enum.scala:22: warning: match may not be exhaustive.
It would fail on the following input: Some((x: Status.Status forSome x not in (Error, Processed, Rendering, Waiting)))
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
| object Status extends Enumeration { | |
| type Status = Value | |
| val Waiting = Value("waiting") | |
| val Rendering = Value("rendering") | |
| val Processed = Value("processed") | |
| val Error = Value("error") | |
| } | |
| object Main extends App { | |
| import Status._ | |
| def foo(s: Status) = { | |
| s match { | |
| case Waiting => | |
| println("A") | |
| case Rendering => | |
| println("B") | |
| case Processed | Error => | |
| println("C") | |
| } | |
| } | |
| def bar(s: Option[Status]) = { | |
| s match { | |
| case Some(Waiting) => | |
| println("A") | |
| case Some(Rendering) => | |
| println("B") | |
| case Some(Processed) | Some(Error) | None => | |
| println("C") | |
| } | |
| } | |
| foo(Waiting) | |
| foo(Error) | |
| bar(Some(Rendering)) | |
| bar(Some(Processed)) | |
| bar(None) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://issues.scala-lang.org/browse/SI-7206