[swift-users] Reordering tuples with named components

tuuranton at tutanota.de tuuranton at tutanota.de
Tue Apr 5 14:40:35 CDT 2016

This code works great in Swift 2.2:
------------func foo() -> (a: String, b: Int) {    return ("asdf", 4)}
var z: (b: Int, a: String)z = foo()
print("\(z.0)") //4print("\(z.1)") //asdf------------

Notice how I have reordered a and b.
As a result the meaning of .0 and .1 have changed.
Can I, or am I likely to be able to, rely on this behavior going forward into 
Swift 2.3, Swift 3, Swift 4 and beyond?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20160405/fed58da0/attachment.html>

More information about the swift-users mailing list