Aaron this works for me in both Swift 2.2 and Swift 3 provided that you remove the ‘throws’ keyword.
What seems odd to me is not the first assignment, but rather the second that _allows_ the use of ‘throws’ when t.1 (i.e. f) does not throw - is your concern the same? Shane On Jul 5, 2016, at 10:48 PM, Aaron Bohannon via swift-users <[email protected]<mailto:[email protected]>> wrote: Yesterday, it was pointed out that a variable name referring to a tuple cannot be used as a pattern. I have noticed another sort of inconsistency in how tuples are treated when they are referenced by name: func f() -> Int { return 5 } let t = ("a", f) let _: (String, () throws -> Int) = t // type error let _: (String, () throws -> Int) = (t.0, t.1) // OK This situation leads to a different sort of type error; however, the error seems equally unwarranted. I can't see any good reason for a well-typed program to become ill-typed when `(t.0, t.1)` is replaced with `t` (assuming `t` is a pair). Should I file a separate bug for the specific example above? - Aaron _______________________________________________ swift-users mailing list [email protected]<mailto:[email protected]> https://lists.swift.org/mailman/listinfo/swift-users
_______________________________________________ swift-users mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-users
