Sbt 0.12.4 - a warning about the functionality of x; re-run with -feature for details

I get an error message there were 15 feature warning(s); re-run with -feature for details there were 15 feature warning(s); re-run with -feature for details :

 $ /usr/local/sbt/bin/sbt [info] Loading project definition from /home/alex/Documents/projects/my_app123/project [info] Set current project to sbt-android (in build file:/home/alex/Documents/projects/my_app123/) > compile -feature [error] Expected end of input. [error] compile -feature [error] ^ > sbt-version [info] 0.12.4 > compile [warn] Credentials file /home/alex/.ivy2/.credentials does not exist [info] Compiling 20 Scala sources to /home/alex/Documents/projects/my_app123/target/scala-2.10/sbt-0.12/classes... [error] there were 15 feature warning(s); re-run with -feature for details [error] one error found [error] (compile:compile) Compilation failed [error] Total time: 27 s, completed 01 12, 15 1:20:12 PM 

In build.sbt

 scalaVersion := "2.10.4" 

I can’t find out what this error is because it doesn’t talk about it even when I run sbt as $ /usr/local/sbt/bin/sbt -feature .

 $ /usr/local/sbt/bin/sbt -feature [info] Loading project definition from /home/alex/Documents/projects/my_app123/project [info] Set current project to sbt-android (in build file:/home/alex/Documents/projects/my_app123/) $ 

This is JDK 1.7

What is a mistake and how to fix it?

UPDATE

build.sbt

 scalacOptions in ThisBuild ++= Seq("-unchecked", "-deprecation") 

or in sbt itself:

> set scalacOptions in ThisBuild ++= Seq("-unchecked", "-deprecation")

The error remains unchanged.

+6
source share
2 answers

I have no way to use sbt on a daily basis, so this is just a suggestion confirmation in the linked answer:

 $ sbt [info] Set current project to Compiler options (in build file:/home/apm/tmp/sbtwarn/) > compile [info] Compiling 1 Scala source to /home/apm/tmp/sbtwarn/target/scala-2.11/classes... [warn] there was one feature warning; re-run with -feature for details [warn] one warning found [success] Total time: 4 s, completed Jan 12, 2015 9:45:17 AM > set scalacOptions in ThisBuild ++= Seq("-feature") [info] Defining {.}/*:scalacOptions [info] The new value will be used by compile:scalacOptions [info] Reapplying settings... [info] Set current project to Compiler options (in build file:/home/apm/tmp/sbtwarn/) > compile [info] Compiling 1 Scala source to /home/apm/tmp/sbtwarn/target/scala-2.11/classes... [warn] /home/apm/tmp/sbtwarn/src/main/scala/Sample.scala:6: postfix operator head should be enabled [warn] by making the implicit value scala.language.postfixOps visible. [warn] This can be achieved by adding the import clause 'import scala.language.postfixOps' [warn] or by setting the compiler option -language:postfixOps. [warn] See the Scala docs for value scala.language.postfixOps for a discussion [warn] why the feature should be explicitly enabled. [warn] Console println (List(1,2,3) head) [warn] ^ [warn] one warning found [success] Total time: 1 s, completed Jan 12, 2015 9:45:46 AM 

Hey, it worked!

+6
source

You must add

 scalacOptions += "-feature" 

in build.sbt and reboot if your sbt console is running (or restarted it).

Alternatively, if you want to install it for only one session, while you can write set scalacOptions += "-feature" in the sbt console, this parameter is applied immediately, there is no need to reboot or restart the sbt console.

Re-run with -feature for details

+2
source

Source: https://habr.com/ru/post/980856/


All Articles