在我的播放应用程序上,我有一个包含公共文件路线的路线文件。最近我添加了-Ywarn-unused
编译器标志,我收到了一些意想不到的警告。
脚步:
activator new testingScalac
(从模板列表中选择 play-scala)- 添加到
build.sbt
标志scalacOptions ++= Seq("-Ywarn-unused")
- 添加到路由文件:
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