[Pitch] Use “some” to express “some specialization of a generic type”

I think that's where I disagree it's better. Although Dictionary is a common type that people are familiar with, seeing some Foo for an unknown type or protocol would become a lot more ambiguous, since it could be either introducing one generic parameter bound to a protocol named Foo, or any number of generic parameters corresponding to the parameters of a generic type Foo.

A reasonable midpoint might be to allow for variadic implicit generic parameters, so you could write

func f(_: Dictionary<some...>)

or whatever syntax we decide for variadic type variables as a way to keep it clear that multiple type parameters are being introduced.

5 Likes