[swift-evolution] Tuple

Fabian Ehrentraud Fabian.Ehrentraud at willhaben.at
Thu Jul 21 01:46:49 CDT 2016

Ok, I created an issue: https://bugs.swift.org/browse/SR-2135

Fabian Ehrentraud
Mobile Developer

willhaben internet service GmbH & Co KG
Landstra├čer Hauptstra├če 97-101, 1030 Wien
M +43 699 1003 1604

DVR 4011331
Firmenbuch Nr. FN 271792 w
Gerichtsstand Handelsgericht Wien
UID Nr. ATU62251468

On 20.07.2016, at 12:07, Zhao Xin <owenzx at gmail.com<mailto:owenzx at gmail.com>> wrote:

I think this should consider as a bug because the Xcode editor suggests the second way but the compiler can't compile.


On Wed, Jul 20, 2016 at 4:08 PM, Fabian Ehrentraud via swift-evolution <swift-evolution at swift.org<mailto:swift-evolution at swift.org>> wrote:

I have a problem with tuple parameter types in a closure. Is this a language restriction or a bug in the Swift compiler? I used the Swift shipped with Xcode beta 3, also tried in Swift 2.2.

let d: [Int: String] = [1:"1", 0:"0"]
let e = d.sorted(isOrderedBefore: { e1, e2 in e1.0 < e2.0 }) // works
let f = d.sorted(isOrderedBefore: { (k1, v1), (k2, v2) in k1 < k2 }) // does not compile

swift-evolution mailing list
swift-evolution at swift.org<mailto:swift-evolution at swift.org>

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

More information about the swift-evolution mailing list