[swift-evolution] Proposal: Remove implicit tuple splat behavior from function applications

Chris Lattner clattner at apple.com
Wed Jan 27 13:42:14 CST 2016


> On Jan 27, 2016, at 11:32 AM, David Waite <david at alkaline-solutions.com> wrote:
> 
> Chris, tell me if this code example clarifies what you are proposing.
> 
> Given:
> func moveTo(x x:Double, y:Double} {/*…*/ }
> moveTo(x:0, y:0)
> 
> This is the behavior that is being proposed to be removed:
> var point = (x:1.0, y:1.0)
> moveTo(point)
> 
> instead, I’d have to do either:
> moveTo(x:point.x, y:point.y)
> 
> or:
> 
> func moveTo(point:(x:Double, y:Double)) {
>   moveTo(x:point.x, y:point.y)
> }

Correct.

> today, I’m not entirely sure the behavior if I defined that second function signature. I’m guessing that is one of the motivators to remove this behavior.

Yes, exactly.  This is an example of the ambiguity that I’m referring to.

-Chris



More information about the swift-evolution mailing list