2

私のプレイアプリには、パブリックファイルのルートを含むルートファイルがあります。最近、-Ywarn-unusedコンパイラ フラグを追加しましたが、予期しない警告が表示されます。

手順:

  1. activator new testingScalac(テンプレートリストから play-scala を選択)
  2. build.sbtフラグに追加scalacOptions ++= Seq("-Ywarn-unused")
  3. ルート ファイルに追加します。

GET /favicon.ico controllers.Assets.at(path="/public",file="/images/favicon.ico")

GET /favicon.png controllers.Assets.at(path="/public",file="/images/favicon.png")

GET /robots.txt controllers.Assets.at(path="/public",file="robots.txt")

ここで、実行すると次のようsbt compileに返されます。

$ sbt compile
[info] Loading project definition from /Users/pedrorijo/git/testRepos/testingScalac/project
[info] Set current project to testingScalac (in build file:/Users/pedrorijo/git/testRepos/testingScalac/)
[info] Compiling 4 Scala sources and 1 Java source to /Users/pedrorijo/git/testRepos/testingScalac/target/scala-2.11/classes...
[warn] /Users/pedrorijo/git/testRepos/testingScalac/conf/routes:15: local val in method at is never used
[warn] GET        /favicon.ico            controllers.Assets.at(path="/public",file="/images/favicon.ico")
[warn] /Users/pedrorijo/git/testRepos/testingScalac/conf/routes:16: local val in method at is never used
[warn] GET        /favicon.png            controllers.Assets.at(path="/public",file="/images/favicon.png")
[warn] /Users/pedrorijo/git/testRepos/testingScalac/conf/routes:17: local val in method at is never used
[warn] GET        /robots.txt             controllers.Assets.at(path="/public",file="robots.txt")
[warn] three warnings found
[success] Total time: 10 s, completed Jul 5, 2016 3:11:28 PM

ルートファイルで何か間違ったことをしていますか、それともプレイフレームワーク/コンパイラのバグですか (github を調べたところ、これに関連するものは見つかりませんでした)?

注: play 2.5.4 を使用していますが、play 2.4.x でも発生します

4

1 に答える 1