Allow static extensions of generic types to be written without where clauses

I understand the point, but considering the source of the 'confusion' is... all over the place in Swift generics, it's really unexpected if what you say is true and the participants of this thread are by far not the only ones who will find this confusing. I guess we need to wait for more feedback.

1 Like

Thanks for understanding there is an ergonomics question as soon as classes and protocols are involved.

Well I get your point here, but I‘m sure that we cannot solve the problem with the same syntax since those constraints are still distinct and something like value subtyping or self-conforming protocols still can be introduced in the future which would break everything if the shortcut syntax had merged rules for : and ==.

The following is bikeshedding that explicitly annotates the requirement of : but it‘s a little bit terse:

extension Array<:UIView> { ... } // noticed the colon before the class?!

And please note that such syntax would prevent us to add labels for generic parameters, which makes it a really a no-go, but again it‘s bikeshedding only.

Looks good to me.