[swift-evolution] [Discussion] Generic protocols

Tino Heth 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.

- Tino
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20161210/4698994d/attachment.html>


More information about the swift-evolution mailing list