Scala:`-` [dash, minus] 命令已弃用,取而代之的是 `onFailure`,并将在 0.14.0 中删除

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

当我在我的 Scala 项目上做 sbt compile -feature 时,我收到一个神秘的警告:

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

我不知道 dash/minus 命令是什么,也不知道它可能被用在哪里。在 google 上搜索它是不可能的,也无法为它搜索代码库(只有 /so/ /many/ /dashes/)。

如果至少我知道它在哪里定义的话。我在 scala 文档中也找不到任何内容。

认为您正在寻找这个:

// 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

此外,可以找到相关问题和信息 here,尤其是如何将 -feature 添加到 scalac 选项。