[swift-evolution] IUO in Swift 3.0

David Hart david at hartbit.com
Tue Jun 21 16:34:39 CDT 2016


Is there a bug tracking the remaining part of the implementation?
Shouldn’t the proposal still be under “Not yet implemented” as its not completely implemented?

David.

> On 21 Jun 2016, at 22:22, Joe Groff <jgroff at apple.com> wrote:
> 
>> 
>> On Jun 21, 2016, at 1:06 PM, David Hart via swift-evolution <swift-evolution at swift.org> wrote:
>> 
>> Just saw this article about IUO in Swift 3.0:
>> 
>> https://www.bignerdranch.com/blog/wwdc-2016-increased-safety-in-swift-3/
>> 
>> I was surprised that the IUO type still exists. From what I understood, SE-0054 gives a clear example that:
>> 
>> func f() -> Int! { return 3 } 
>> // f: () -> Int?, has IUO attribute
>> // ...
>> 
>> let x3: Int! = f() 
>> // succeeds; x3: Int? = .some(3), has IUO attribute
>> // ...
>> 
>> func g() -> Int! { return nil } 
>> // f: () -> Int?, has IUO attribute
>> // ...
>> 
>> let y3: Int! = g() // succeeds; y3: Int? = .none, has IUO attribute
>> 
>> x3 and y3 should be a of type Int? but trying those out in Xcode 8’s beta 1 playground show that they are still of type Int!. Did I miss something?
> 
> SE-0054 hasn't been fully implemented yet. The stricter implicit promotions are mostly there, but the IUO type still exists.
> 
> -Joe

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160621/fcb44928/attachment.html>


More information about the swift-evolution mailing list