Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/scala/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Scala 播放框架路由文件编译警告:从未使用处方法中的本地val_Scala_Playframework_Compiler Flags_Scalac - Fatal编程技术网

Scala 播放框架路由文件编译警告:从未使用处方法中的本地val

Scala 播放框架路由文件编译警告:从未使用处方法中的本地val,scala,playframework,compiler-flags,scalac,Scala,Playframework,Compiler Flags,Scalac,在我的play应用程序中,我有一个包含公用文件路由的路由文件。最近我添加了-Ywarn unused编译器标志,并收到一些意外警告 步骤: activator new testingScalac(从模板列表中选择播放scala) 向build.sbt添加带有scalacOptions++=Seq(“-Ywarn unused”) 添加到路由文件: GET/favicon.ico controllers.Assets.at(path=“/public”,file=“/images/favicon.

在我的play应用程序中,我有一个包含公用文件路由的路由文件。最近我添加了
-Ywarn unused
编译器标志,并收到一些意外警告

步骤:

  • activator new testingScalac
    (从模板列表中选择播放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
    
    我是否在路由文件上做了一些错误的事情,或者是playframework/编译器错误(我在github中查找了,但找不到任何与此相关的东西)

    注意:它使用播放2.5.4,但也发生在播放2.4.x上


    创建了一个问题,它似乎是一个游戏框架问题:


    与此同时,已经完成了一个PR,可能会修复:

    这是一个警告,而不是一个bug,即使我不会称之为bug,因为它“只是”引发警告,但我确实使用了致命警告标志,这会导致编译失败,并出现任何警告。无论如何,我建议你用一个显示问题的小项目来打开一个问题。我对play 2.5.15有同样的警告。您是否已经有了解决方案?在github上发行一期怎么样?