9

When I'm doing sbt compile -feature on my Scala project I get a mysterious warnings:

The `-` command is deprecated in favor of `onFailure` and will be removed in 0.14.0

I have no clue what that dash/minus command is or where it is possibly being used. Searching for it on google is impossible, as well as grepping the code base for it (There are just /so/ /many/ /dashes/).

If at least I knew where it is defined. I could not find anything in the scala doc either.

scravy
  • 11,904
  • 14
  • 72
  • 127
  • 1
    Possible duplicate of [Play, re-run with -feature for details](http://stackoverflow.com/questions/23926515/play-re-run-with-feature-for-details) – Seth Tisue Oct 08 '15 at 13:27
  • it took me a little bit to actually understand that this is a duplicate, but it most certainly is :-| – scravy Oct 09 '15 at 13:54

1 Answers1

3

I think you're looking for this:

// commands with poor choices for names since they clash with the usual conventions for command line options
//   these are not documented and are mainly internal commands and can be removed without a full deprecation cycle
object Compat {
    def OnFailure = "-"
    ...
    def OnFailureDeprecated = deprecatedAlias(OnFailure, BasicCommandStrings.OnFailure)
    ...
    private[this] def deprecatedAlias(oldName: String, newName: String): String =
        s"The `$oldName` command is deprecated in favor of `$newName` and will be removed in 0.14.0"
}

Source here

Also, kind-of related question and pieces of information can be found here, especially how to add the -feature to scalac options.

Community
  • 1
  • 1
Patryk Ćwiek
  • 14,078
  • 3
  • 55
  • 76
  • Now I get what is going on... the -feature flag is required by scalac not sbt which is invoking scalac.. alright :-) – scravy Oct 09 '15 at 13:54