[swift-evolution] [Pitch] Moving where Clauses Out Of Parameter Lists

Joe Groff jgroff at apple.com
Wed Apr 6 15:34:18 CDT 2016


> On Apr 6, 2016, at 1:21 PM, Pyry Jahkola <pyry.jahkola at iki.fi> wrote:
> 
>> Joe Groff wrote:
>> 
>> It's a judgment call. It's my feeling that in many cases, a generic parameter is constrained by at least one important protocol or base class that's worth calling out up front, so it's reasonable to allow things like 'func foo<C: Collection>(x: C) -> C.Element' without banishing the 'Collection' constraint too far from the front of the declaration.
> 
> Fair enough. I think it would be clearer if all the constraints appeared in one standard place (in the `where` clause).

That's definitely a reasonable position worth discussing.

-Joe


More information about the swift-evolution mailing list