Using ImplicitlyUnwrappedOptional in v3.4 compatibility

This might be a silly question, but would the proposal to abolish Implicitly Unwrapped Optionals (https://github.com/apple/swift-evolution/blob/master/proposals/0054-abolish-iuo.md) cause IUOs to get removed when compiling a swift 4 target that depends on swift 3? Or did IUOs possibly also get removed in v3.4 as the proposal suggests, although I can't seem to find anything that supports or negates this.

For example, say we have an app target that compiles with swift v4 that depends on a target A which compiles with swift 3, the following code fails to compile inside Target A containing:

if !swift(>=4.1.50)
extension ImplicitlyUnwrappedOptional {
...
}
#endif

The compiler throws "ImplicitlyUnwrappedOptional has been renamed to Optional", even though the target Swift Language Version is v3 where IUOs supposedly still are acceptable.

Check out "Reimplementation of Implicitly Unwrapped Optionals" on the Swift project blog. You're right, it is a source break…but the compiler didn't actually let you use the methods you defined on the IUO anyway, so it was considered an acceptable one. If it's protocols you were using, you can move them over to Optional and everything will be fine.

1 Like

Ah I see. Thanks for the explanation!