Swift 4.1.50 是什么?

What is Swift 4.1.50?

我正在玩 Xcode 10 beta,我在编译时检查 Swift 版本号时注意到 Swift 语言版本 设置为 Swift 4 在他们的构建设置中报告为 Swift 4.1.50 (beta 2、3 和 4 这样做;我没有机会测试 beta 1)。这让我觉得……至少可以说很奇怪。 Xcode、Xcode 9.4.1 的当前 AppStore 版本报告其版本为 Swift 4.1.2.

所以... Swift 4.1.3 到 4.1.49 发生了什么? 或者这是我应该提交的错误?或者 50 在某种程度上很重要?


你可以用我的测试文件自己测试一下,Swift Version Checker


根据 Jordan Rose 在 Swift bug tracker 上的说法:

This is the least bad answer we could come up with, given that we may still release more 4.1.x versions if there's, say, a bad security vulnerability in one of them. (This has happened before.) We needed a version number that was greater than any existing 4.1 version, but still less than 4.2.

We did consider other ideas, but this is the one we went with for maximum compatibility. We at least won't have this problem in the future thanks to SE-0212.

因此,我从中得出的结论是,未来某个时候可能仍需要发布实际的 4.1 版本,但这只是 4.1.2 之上的安全补丁,因此其逻辑编号为4.1.3.同时,Swift 4.2 编译器可以消化的伪 4.1 Swift 需要它自己的编号,这也反映了它是 4.1 的方言,他们的结论是 4.1.50,安全地远离4.1.2 允许尽可能多的安全补丁。