4

アプリを play 2.0.4 から play 2.1 に移行しています

ただし、次のコードではこの警告が発生します。

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]             ^

play 2.0.4 (scala 2.9.1) では問題なく動作しましたが、このバージョン (scala 2.10) ではこの警告が表示されます

何が間違っている可能性がありますか?

4

4 に答える 4

5

もしかしてこれ?

追加するとどうなるか

scalacOptions ++= Seq("-Dscalac.patmat.analysisBudget=1024")

あなたのproject/Build.scala

【更新・訂正】

私は間違っていましたscalacOptions--Dオプションは、への引数ではなく、JVM引数として渡す必要がありますscalacsbt/環境、変数をplay尊重するので、実行するか、このように試すことができますか?JAVA_OPTSplaysbt

JAVA_OPTS="-Dscalac.patmat.analysisBudget=off" sbt
# Or
JAVA_OPTS="-Dscalac.patmat.analysisBudget=off" play

Unix-y OS を使用していると仮定しています。

于 2012-11-20T13:44:51.457 に答える
2

同じ問題が発生しました(ただし、Playでは発生しません)。より永続的な修正を行うには、ファイルを作成し、~/.sbtconfig次の行を追加するだけです。

#!/bin/sh
SBT_OPTS="-Dscalac.patmat.analysisBudget=off"

このファイルとそのSBT_OPTS中に定義されているファイルは、を実行するたびに使用されますsbt。Playを入手した場所によっては、独自のバージョンのsbtがバンドルされている場合があり、起動時にこのファイルを使用しない場合があります。

于 2013-02-22T01:18:36.400 に答える
1

プロジェクトごと」の SBT 構成の場合、これを.scalaビルド ファイルに追加します。

initialize ~= { _ => sys.props("scalac.patmat.analysisBudget") = "off" }
于 2014-01-22T15:25:48.860 に答える