> On Feb 28, 2017, at 10:39 PM, David Hart <[email protected]> wrote:
> 
>> 
>> On 28 Feb 2017, at 22:53, Jordan Rose via swift-evolution 
>> <[email protected] <mailto:[email protected]>> wrote:
>> 
>> Nitpick: 'C<T> & P' is just 'C<T>' in this example. You'd need a refinement 
>> of 'P' to make it interesting ('C<T> & Q’).
> 
> Could generic specialisation be disallowed in constraints? I need to think 
> about this.

I don't think there's any added complexity alone in allowing generic base class 
constraints in existentials, since we already support `<T: C<U>>` as a 
constraint on a generic parameter. It's the interaction between classes and 
protocols with associated types that's interesting. You don't even need a 
generic class:

protocol P { associatedtype T; func foo(_: T) }
class C: P { func foo(_: Int) {} }

protocol Q: P {}

let x: C & Q

-Joe
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to