Scala: The `-` [dash, minus] command is deprecated in favor of `onFailure` and will be removed in 0.14.0
Asked Answered
L

1

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.

Limen answered 8/10, 2015 at 13:11 Comment(2)
Possible duplicate of Play, re-run with -feature for detailsCrossjack
it took me a little bit to actually understand that this is a duplicate, but it most certainly is :-|Limen
G
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.

Goofball answered 8/10, 2015 at 13:16 Comment(1)
Now I get what is going on... the -feature flag is required by scalac not sbt which is invoking scalac.. alright :-)Limen

© 2022 - 2024 — McMap. All rights reserved.