当我在Scala项目中执行sbt compile -feature时,我得到一个神秘的警告:

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

我不知道破折号/减号命令是什么或可能在哪里使用。在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选项中。

10-08 02:15