加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

我如何找到scala编译器标志/选项的描述?

发布时间:2020-12-16 09:44:32 所属栏目:安全 来源:网络整理
导读:如何找到最新的scalac版本的所有标志?经过几个小时的搜索,我发现只有 outdated docs.(例如,他们甚至没有提到“特征”标志)。 有没有办法从scalac或其他任何东西获得编译器标志列表? 解决方法 我们大多数人用scalac -help,scalac -X和scalac -Y。 也不要
如何找到最新的scalac版本的所有标志?经过几个小时的搜索,我发现只有 outdated docs.(例如,他们甚至没有提到“特征”标志)。

有没有办法从scalac或其他任何东西获得编译器标志列表?

解决方法

我们大多数人用scalac -help,scalac -X和scalac -Y。

也不要忘记scala -help。

编辑:sbt用户可以按照惯例:

> set scalacOptions in Compile += "-X"
> compile
[snip]
[info]   -Xcheck-null                   Warn upon selection of nullable reference.
[info]   -Xcheckinit                    Wrap field accessors to throw an exception on uninitialized access.
[info]   -Xdisable-assertions           Generate no assertions or assumptions.
[info]   -Xdivergence211                Turn on the 2.11 behavior of implicit divergence not terminating recursive implicit searches (SI-7291).
[info]   -Xelide-below <n>              Calls to @elidable methods are omitted if method priority is lower than argument
[info]   -Xexperimental                 Enable experimental extensions.
[info]   -Xfatal-warnings               Fail the compilation if there are any warnings.
[snip]

至少手册页最近已更新:

https://issues.scala-lang.org/browse/SI-7824

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读