[swift-evolution] 'T != Type' in where clause

David Sweeris davesweeris at mac.com
Wed Mar 1 19:27:08 CST 2017


> On Feb 28, 2017, at 09:01, Joe Groff <jgroff at apple.com> wrote:
> 
> 
>> On Feb 27, 2017, at 10:21 PM, David Sweeris via swift-evolution <swift-evolution at swift.org> wrote:
>> 
>> + all the 1s, along with something like "where !(T: Foo)"
> 
> This is an impossible constraint to enforce, since anyone can extend any type to conform to Foo.

Only for protocols, right? I mean, as far as I know, you can’t declare a superclass in an extension.

I've been thinking about this for, well, about a day and a half, and I don't understand why it’s a problem. Wouldn’t any concrete type’s conformance propagate through the type system? How else would generic functions deal with types being extended outside the generic function’s module?

- Dave Sweeris


More information about the swift-evolution mailing list