启用迁移警告
我正在将 2.7.7 scala 代码库移植到 2.8,并且想知道是否有编译器选项来显示迁移通知?我被可变序列的行为变化所困扰,该序列具有以下迁移通知[1],但是当我构建项目时它不会显示任何内容(我已经启用了弃用和未经检查的警告)
1:@migration (2, 8, "从 2.8 开始,此操作创建一个新地图。将元素添加为\n"+ “对现有地图产生副作用并返回该地图本身,使用 +=。” )
I am porting a 2.7.7 scala code base over to 2.8 and was wondering if there was a compiler option to display migration notices? I was bitten by a change in behavior for mutable sequences that had the following migration notice[1], however it doesn't display anything when I build the project ( I have deprecation and unchecked warnings enabled already)
1: @migration(2, 8,
"As of 2.8, this operation creates a new map. To add an element as a\n"+
"side effect to an existing map and return that map itself, use +=."
)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
选项为:
-Xmigration
输入
scalac -help
将显示Scala编译器的标准选项。输入 scalac -X 将显示高级选项。
输入 scalac -Y 将会显示私有选项。
The option is:
-Xmigration
Entering
scalac -help
will show the standard options of the Scala compiler.Entering
scalac -X
will show the advanced options.Entering
scalac -Y
will show the private options.它是一个扩展选项,
-Xmigration
。It's a extended option,
-Xmigration
.