[swift-evolution] [Review] SE-0046 Establish consistent label behavior across all parameters including first labels

Ben Rimmington me at benrimmington.com
Sun Mar 13 18:14:11 CDT 2016


> On 13 Mar 2016, at 21:35, Brent Royal-Gordon via swift-evolution <swift-evolution at swift.org> wrote:
> 
> Now that we're going to have consistent rules everywhere else, I think the design team should also consider applying the same rules to subscripts. Unlike functions, subscripts still *do* usually have unlabeled first parameters, but they are written so rarely that I'm not sure it's worth being inconsistent with literally every other parameter construct in the language.
> 
> (Alternatively, making all subscript parameters unlabeled would be a simpler rule than the current one, and would suit multi-dimensional subscripts pretty nicely.)

All subscript parameters _are_ unlabelled by default.

There are also different rules for:

* operator functions (which cannot have argument labels);
* closure parameters (which cannot have parameter names).

-- Ben


More information about the swift-evolution mailing list