Jer*_*iho 33 scala scalac scala-compiler
如何找到最新scalac版本的所有标志?谷歌搜索了几个小时后,我发现只有过时的 文档.(例如,他们甚至没有提到"-feature"标志).
有没有办法从scalac或其他任何东西获取带有描述的编译器标志列表?
som*_*ytt 26
编辑:已发布Scala编译器选项的文档.
我们中的大多数与度日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]
Run Code Online (Sandbox Code Playgroud)
至少手册页最近更新了:
https://issues.scala-lang.org/browse/SI-7824
Chr*_*rie 24
我能找到的最接近的是编译器的相关源文件.不幸的是,这些选项分散在几个文件中.在撰写本文时,它会像这样崩溃:
这些当然是针对当前开发版本的编译器,因此如果您需要特定版本的选项,则scalac需要使用"分支"下拉菜单查看正确的版本标记.