[swift-users] How to use a protocol to infer a generic type with constraints

David Sweeris davesweeris at mac.com
Tue May 2 13:05:40 CDT 2017


> On May 2, 2017, at 10:16 AM, Edward Connell via swift-users <swift-users at swift.org> wrote:
> 
> Does anyone have an idea when this is going to be fixed? Or when support will be implemented?
> My app heavily uses collections of heterogenous plug-ins, so it's a real pain in the neck to work around.

My understanding is that allowing protocols to conform to themselves would be a *ton* of work. That’s not to say it’ll never happen, but the current behavior isn’t considered a bug, and I don’t think the feature is likely to happen without a proposal getting accepted on swift-evolution (it’s come up a few times before… IIRC it’s always been shot down because something like “yes, we’d all like it, but we only have so much time before the next release and there’s some much lower-hanging fruit that we should work on first”).

Feel free to start another thread about it… it’d get a +1 from me. I’d almost bet money though that it won’t happen until at least Swift 5 (unless it’s a surprise at WWDC or something).

- Dave Sweeris


More information about the swift-users mailing list