Scala 启用迁移警告
我正在将一个2.7.7 scala代码库移植到2.8,我想知道是否有一个编译器选项来显示迁移通知?我被具有以下迁移通知[1]的可变序列的行为变化所困扰,但是在我构建项目时它没有显示任何内容(我已经启用了弃用和未检查的警告) 1:Scala 启用迁移警告,scala,warnings,scala-2.8,Scala,Warnings,Scala 2.8,我正在将一个2.7.7 scala代码库移植到2.8,我想知道是否有一个编译器选项来显示迁移通知?我被具有以下迁移通知[1]的可变序列的行为变化所困扰,但是在我构建项目时它没有显示任何内容(我已经启用了弃用和未检查的警告) 1:@迁移(2,8,, 从2.8开始,此操作将创建一个新映射。若要将元素添加为映射,请执行以下操作\n+ 对现有映射产生副作用并返回该映射本身,请使用+= )选项为:-Xmigration 输入scalac-help将显示Scala编译器的标准选项 输入scalac-X将显示
@迁移(2,8,,
从2.8开始,此操作将创建一个新映射。若要将元素添加为映射,请执行以下操作\n+
对现有映射产生副作用并返回该映射本身,请使用+=
)
选项为:-Xmigration
输入scalac-help
将显示Scala编译器的标准选项
输入scalac-X
将显示高级选项
输入
scalac-Y
将显示私有选项。这是一个扩展选项,-Xmigration
~: scala -X
Usage: scala <options> <source files>
Possible advanced options include:
-Xassem-extdirs <dirs> List of directories containing assemblies, defaults to `lib'
-Xassem-name <file> Name of the output assembly (only relevant with -target:msil)
-Xassem-path <path> List of assemblies referenced by the program (only relevant with -target:msil)
-Xcheck-null Emit warning on selection of nullable reference
-Xcheckinit Add runtime checks on field accessors. Uninitialized accesses result in an exception being thrown.
-Xdisable-assertions Generate no assertions and assumptions
-Xelide-below Generate calls to @elidable-marked methods only if method priority is greater than argument.
-Xexperimental Enable experimental extensions
-Xfatal-warnings Fail the compilation if there are any warnings.
-Xfuture Turn on future language features
-Xgenerate-phase-graph <file> Generate the phase graphs (outputs .dot files) to fileX.dot
-Xlog-implicits Show more info on why some implicits are not applicable
-Xmigration Warn about constructs whose behavior may have changed between 2.7 and 2.8
-Xno-forwarders Do not generate static forwarders in mirror classes
-Xno-uescape Disables handling of \u unicode escapes
-Xnojline Do not use JLine for editing
-Xplugin-disable:<plugin> Disable a plugin
-Xplugin-list Print a synopsis of loaded plugins
-Xplugin-require:<plugin> Abort unless a plugin is available
-Xplugin:<file> Load a plugin from a file
-Xpluginsdir <path> Path to search compiler plugins
-Xprint-icode Log internal icode to *.icode files
-Xprint-pos Print tree positions (as offsets)
-Xprint-types Print tree types (debugging option)
-Xprint:<phase> Print out program after <phase> or "all"
-Xprompt Display a prompt after each error (debugging option)
-Xresident Compiler stays resident, files to compile are read from standard input
-Xscript <object> Compile as a script, wrapping the code into object.main()
-Xshow-class <class> Show class info
-Xshow-object <object> Show object info
-Xshow-phases Print a synopsis of compiler phases
-Xsource-reader <classname> Specify a custom method for reading source files
-Xsourcedir <directory> When -target:msil, the source folder structure is mirrored in output directory.
-Xwarninit Warn about possible changes in initialization semantics
-Y Print a synopsis of private options
~:scala-X
用法:scala
可能的高级选项包括:
-Xassem extdirs包含程序集的目录列表,默认为'lib'
-输出程序集的Xassem名称(仅与-target:msil相关)
-程序引用的程序集的Xassem路径列表(仅与-target:msil相关)
-Xcheck null在选择可空引用时发出警告
-Xcheckinit在字段访问器上添加运行时检查。未初始化的访问会导致引发异常。
-xDisableAssertions不生成断言和假设
-只有当方法优先级大于参数时,下面的Xelide才会生成对@elidable标记方法的调用。
-XeExperimental启用实验扩展
-如果存在任何警告,Xfatal警告将导致编译失败。
-Xfuture启用未来的语言功能
-生成相图生成相图(输出.dot文件)到fileX.dot
-Xlog IMPLITS显示有关为什么某些IMPLITS不适用的更多信息
-Xmigration警告行为可能在2.7和2.8之间发生更改的构造
-Xno转发器不会在镜像类中生成静态转发器
-Xno uescape禁用\u unicode转义的处理
-Xnojline请勿使用JLine进行编辑
-xplugindisable:禁用插件
-Xplugin列表打印加载插件的概要
-Xplugin require:Abort,除非插件可用
-Xplugin:从文件加载插件
-Xpluginsdir搜索编译器插件的路径
-将icode日志内部icode打印到*.icode文件
-Xprint pos打印树位置(作为偏移)
-Xprint类型打印树类型(调试选项)
-Xprint:在或“全部”之后打印程序
-Xprompt在每个错误后显示提示(调试选项)
-Xresident编译器保持驻留状态,要编译的文件从标准输入读取
-Xscript作为脚本编译,将代码包装到object.main()中
-Xshow类显示类信息
-Xshow对象显示对象信息
-Xshow阶段打印编译器阶段的概要
-Xsource reader指定用于读取源文件的自定义方法
-Xsourcedir When-target:msil,源文件夹结构在输出目录中镜像。
-Xwarninit警告初始化语义中可能的更改
-Y打印私人选择的摘要
%scala-X
用法:scala
可能的高级选项包括:
...
-Xmigration警告行为可能在2.7和2.8之间发生更改的构造
...
% scala -X
Usage: scala <options> <source files>
Possible advanced options include:
...
-Xmigration Warn about constructs whose behavior may have changed between 2.7 and 2.8
...