Question

I am new to Scala, Scala-IDE, and Play 2.1 and am working my way through the tutorials. Today I noted that the Eclipse Project emitted by the "todolist" tutorial shows up in the Scala-IDE with a Warning that I don't understand and would like to see go away.

This answer How to get more information about 'feature' flag warning? suggests that I need only add...

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

...to my sbt build definition file which, I thought, was project/Build.scala for a Play 2.1 project. Trying to put it in there, however...

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")
  )

}

..., results in a compile error...

[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? 

If I want to set scalacOptions in my sbt build definition in Play 2.1 where do I specify it and how?

Was it helpful?

Solution

Try it without the "...". The dots represented an omission in the other answer.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top