9

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

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

我不知道那个破折号/减号命令是什么或它可能在哪里使用。在谷歌上搜索它是不可能的,以及为它寻找代码库(只有 /so/ /many/ /dashes/)。

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

4

1 回答 1

3

你正在寻找这个:

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

来源在这里

此外,可以在这里找到一些相关的问题和信息,尤其是如何添加-feature到 scalac 选项。

于 2015-10-08T13:16:04.603 回答