[SR-8071] CaseIterable
declared in Swift 4.2 compatibility modes
#50604
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
standard library
Area: Standard library umbrella
Environment
Apple Swift version 4.2 (swiftlang-1000.0.16.9 clang-1000.10.25.3)
Target: x86_64-apple-darwin17.5.0
macOS 10.13.4
Xcode 10 beta 2 (tools version, Xcode 10)
Additional Detail from JIRA
md5: d74cac47dc960580b2ed4091002580da
Issue Description:
`CaseIterable` was introduced in Swift 4.2, yet when compiling projects with the Swift 4.2 compiler in Swift 4.0 compatibility mode, the protocol is available. This is creating problems with a shim `CaseIterable` protocol I would like to declare only in < Swift 4.2.
When running Swift 4.1 compiler, `CaseIterable` is usable. When running Swift 4.2 compiler in 4.0 compat mode, `CaseIterable` becomes ambiguous.
Using the placeholder #compiler directive, I can get this to work.
This solution works fine for me, but I wanted to notify you all in case this is unexpected behavior.
Thanks and keep up the great work on Swift 4.2!
The text was updated successfully, but these errors were encountered: