【问题标题】:How to overcome "there were 1 feature warning(s); re-run with -features for details"如何克服“有 1 个功能警告;使用 -features 重新运行以获取详细信息”
【发布时间】:2013-05-14 17:41:49
【问题描述】:

我是 Scala、Scala-IDE 和 Play 2.1 的新手,并且正在学习教程。今天我注意到“todolist”教程发出的 Eclipse 项目出现在 Scala-IDE 中,并带有一个我不理解并希望消失的警告。

这个答案How to get more information about 'feature' flag warning? 表明我只需要添加...

scalacOptions ++= Seq(... "-feature")

...到我的 sbt 构建定义文件,我认为它是用于 Play 2.1 项目的 project/Build.scala。然而,试图把它放在那里......

import sbt._
import Keys._
import play.Project._

object ApplicationBuild extends Build {

  val appName         = "todolist"
  val appVersion      = "1.0-SNAPSHOT"

  val appDependencies = Seq(
    // Add your project dependencies here,
    jdbc,
    anorm
  )

  val main = play.Project(appName, appVersion, appDependencies).settings(
    // Add your own project settings here
    scalacOptions ++= Seq(... "-feature")
  )

}

...,导致编译错误...

[info] Loading project definition from /Users/bobk/work/todolist/project
[error] /Users/bobk/work/todolist/project/Build.scala:18: illegal start of simple expression
[error]     scalacOptions ++= Seq(... "-feature")
[error]                           ^
[error] /Users/bobk/work/todolist/project/Build.scala:21: ')' expected but '}' found.
[error] }
[error] ^
[error] two errors found
[error] (compile:compile) Compilation failed
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? 

如果我想在 Play 2.1 的 sbt 构建定义中设置 scalacOptions,我在哪里指定它以及如何指定?

【问题讨论】:

标签: sbt playframework-2.1 scala-ide


【解决方案1】:

试试不带“...”。圆点代表另一个答案中的遗漏。

【讨论】:

  • 另一个答案是没有了……
  • 我的评论同样适用于问题的代码示例块。
猜你喜欢
  • 2015-03-09
  • 2018-05-23
  • 2014-07-18
  • 2014-07-18
  • 1970-01-01
  • 2012-03-23
  • 1970-01-01
  • 1970-01-01
  • 2020-12-05
相关资源
最近更新 更多