Scala:版本之间的二进制不兼容 [英] Scala: binary incompatibility between releases

查看:66
本文介绍了Scala:版本之间的二进制不兼容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么不同版本的 Scala 二进制文件不兼容?

Why is Scala binary incompatible between different releases?

推荐答案

这与 trait 的编译方式有关,因为 trait 有点像接口,但它们可以包含实现.这使得进行不破坏源兼容性但破坏二进制兼容性的更改非常容易,因为当您将新方法与实现一起添加到特征时,您必须重新编译实现该特征的所有内容,以便它们将拿起那个实现.可能还有其他问题,但我认为它们大多是相同的.

It has to do with the way traits are compiled, because traits are kind of like interfaces but they can contain implementation. This makes it so it is VERY easy to make changes that don't break source compatibility but break binary compatibility, because when you add a new method to a trait along with an implementation, you have to recompile everything that implements that trait so that they will pickup that implementation. There's probably other issues, too, but I think they're mostly along the same lines.

这篇关于Scala:版本之间的二进制不兼容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆