scala: Cannot check match for unreachability
pattern-matching, playframework-2.0, playframework-2.1, scala
Solution
Maybe this?
What happens if you add
scalacOptions ++= Seq("-Dscalac.patmat.analysisBudget=1024")
to your `project/Build.scala`?
[UPDATE / CORRECTION]
I was wrong about `scalacOptions` - `-D` options need to be passed as JVM arguments, not arguments to `scalac`. Since `sbt`/`play` respect the `JAVA_OPTS` environment, variable, maybe you could try running `play` or `sbt` like this?
JAVA_OPTS="-Dscalac.patmat.analysisBudget=off" sbt
# Or
JAVA_OPTS="-Dscalac.patmat.analysisBudget=off" play
That's assuming you are on a Unix-y OS.
Problem
I'm migrating an app from play 2.0.4 to play 2.1 But the following code raises this warning: ``` def toConditionOperator(value: String): ConditionOperator.Value = { if (value==null) { ConditionOperator.Unknown } else { value.toLowerCase match { case "equal" | "=" | ":" => ConditionOperator.Equal case "notequal" | "!=" | "!:" | "<>" => ConditionOperator.NotEqual case "greaterorequal" | ">=" => ConditionOperator.GreaterOrEqual case "greater" | ">" => ConditionOperator.Greater case "lessorequal" | "<=" => ConditionOperator.LessOrEqual case "less" | "<" => ConditionOperator.Less case "between" => ConditionOperator.Between case "in" => ConditionOperator.In case "startswith" => ConditionOperator.StartsWith case "endswith" => ConditionOperator.EndsWith case "contains" | "$" => ConditionOperator.Contains case "missing" | "" => ConditionOperator.Missing case "unknown" | _ => ConditionOperator.Unknown } } } [info] Compiling 98 Scala sources and 2 Java sources to /home/sas/tmp/ideas-ba/webservice/target/scala-2.10/classes... [warn] /home/sas/tmp/ideas-ba/webservice/app/utils/query/ConditionParser.scala:203: Cannot check match for unreachability. [warn] (The analysis required more space than allowed. Please try with scalac -Dscalac.patmat.analysisBudget=512 or -Dscalac.patmat.analysisBudget=off.) [warn] value.toLowerCase match { [warn] ^ ``` In play 2.0.4 (with scala 2.9.1) it worked ok, with this version (scala 2.10) it yields this warning Any idea what could be wrong?