[swift-evolution] [Discussion] Generic protocols
2th at gmx.de
Sat Dec 10 03:48:34 CST 2016
> It seems like a lot of you are just trying to make different syntaxes for generic protocols, which I’m pretty sure was never the concern about them? We already have reasonable prior art here from the syntax of generic structs.
yeah, this discussion has gotten much bigger than I expected:
Just add the common generic-syntax to protocols, and let somebody do the real work ;-).
Stuff like multi-conformance might be useful for some people, but who actually misses it now?
As long as I can write
SomeProtocol<T> instead of creating SomeProtocolInt, SomeProtocolString and SomeProtocolWhatever imho there would already be a huge benefit.
To make things simpler, it would even be feasible to forbid associated types in generic protocols (if this helps):
As soon as associated types are in the mix, I can't create Set<SomeProtocol<T>> (just an example) anymore, so I can turn the parameter into an associated type as well.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution