[swift-evolution] [Review] SE-0111: Remove type system significance of function argument labels

Tino Heth 2th at gmx.de
Mon Jul 4 01:50:10 CDT 2016

Overall, -1.

I agree that labels should not affect the type, but imho the current status (Swift 2.3 — I haven't checked Version 3) is fine, and the proposal doesn't achieve what it says in the title:
For me, that is no question of types at all, but only of names:

var a: (Int, z: Int) -> Void = t
var b: (y: Int, z: Int) -> Void = t

a = b

This works, because a and b are both of type (Int, Int) -> Void, and the labels aren't significant.

So the proposal merely disallows labels in the declaration of function variables, which I consider bad, because labels convey the meaning of parameters. Why should something that is widely seen as a good feature of functions be removed from function variables?

If you share the opinion that labels are part of the name, the battleship example no good argument against labels:
No one stops you from doing

let minimum: (Int, Int) -> Int = max
Which is confusing as well.

Best regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160704/73f35ada/attachment.html>

More information about the swift-evolution mailing list