> On Jun 30, 2017, at 6:17 PM, Daryle Walker via swift-evolution 
> <swift-evolution@swift.org> wrote:
> 
> Given a type MyType, how can I get a type-alias to the type’s protocols? If 
> MyType conforms to Protocol1 and Protocol2, I would want something like
> 
>       typealias MyProtocol = Protocol1 & Protocol2
> 
> (and Any if MyType doesn’t conform to any protocols). Does this facility 
> already exist in Swift? I don’t think it does, so I proposed the hybrid 
> “MyType.Protocol” syntax to express the idea.

Leave the syntax aside. What are you planning to do with this feature? I 
understand that you want to have some way of saying "composition of all 
protocols this type conforms to"; I don't understand *why* you want it or what 
kind of code you would need it for.

-- 
Brent Royal-Gordon
Architechies

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to