New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SR-12666] Remove the open/frozen enum language dialect #55110
Comments
@swift-ci create |
With SwiftCrypto (Swift-LE on Linux but Swift+LE on Darwin because it just re-exports CryptoKit) this is an especially annoying problem: https://twitter.com/krzyzanowskim/status/1405830734934331396 |
CC @jckarter/@tomerd Any chance this could be sorted out? |
Concretely this does not really affect Swift Crypto. The only enums in the public API of CryptoKit are error enums, and they are essentially never switched over. This affects CryptoSwift, which Marcin maintains. |
thank you @Lukasa! |
This is affecting Swift-DocC as we try to expand our data model (cf. apple/swift-docc#358 (comment)). Since packages can't reliably enable LE (and LE is a wide swath of guarantees to add just for nonfrozen enums), we're stuck adding a hacky underscored "please use a default case" enum case instead. |
Additional Detail from JIRA
md5: 13f02b076545191585eaef8de5234844
Issue Description:
Currently, Swift has at least two language dialects:
Swift with library evolution on (
Swift+LE
)Swift with library evolution off (
Swift-LE
)To my knowledge, there's only one semantic difference:
Swift+LE
'senum
s are open by default and can be closed by using@frozen
Swift-LE
'senum
s are closed by default and CANNOT be openThat leaves us in
Swift-LE
land in a terrible position (eg. apple/swift-nio#1428 , apple/swift-nio#969 ): Not only do we have a different default,Swift-LE
actually literally cannot express the default behaviour ofSwift+LE
...The text was updated successfully, but these errors were encountered: