[swift-evolution] Question about heterogeneous collections

Jason Sadler jason.sadler at gmail.com
Fri Apr 1 13:32:27 CDT 2016


Thanks everyone for your answers - this has helped p a lot. However because I’m not a language design pro, I’m a little unclear still on what the difference is between `Element == MyProtocol` and `Element: MyProtocol`. Obviously the latter is “Element conforms to MyProtocol” but I don’t know how to make an English sentence out of the former.

I re-read some of the Generics chapter in the Swift book this morning but I wasn’t able to solidify my model of these two concepts.  Based on the lack of information when searching on Stack Overflow (the most helpful thing I’ve found was this, which suggests putting things in a box: http://stackoverflow.com/questions/33112559/protocol-doesnt-conform-to-itself/33524927#33524927) and asking on swift-users, could I suggest that this could use some more explicit documentation somewhere?

Thanks again,
Jason


More information about the swift-evolution mailing list