XCode Version 8.2.1 (8C1002), MacOS 10.12.3 (16D32)
The following code compiles and yields somewhat unexpected results.
Here are the results in the Playground:
With argument label looks fine:
Without argument label seems strange:
- odd: Swift interpreted the two parameters as a Tuple. Is that correct, though? Are the parentheses allowed to serve double-duty both as part of the function-call expression and as part of the tuple expression?
- labels: The issue with double-duty parentheses isn’t limited to anonymous tuples. The compiler treats what looks like two labeled function-call parameters as a tuple with two Ints labeled
- nestedTuple: This is not a tuple of a tuple, but just a two-element tuple
I wrote up more details on my blog before I discovered that this issue-tracker for Swift.