[swift-evolution] Generalised concrete-type existentials

Karl Wagner razielim at gmail.com
Mon Mar 20 16:28:46 CDT 2017


> That is to say that “Array <T> & Equatable” would be a nonsense constraint, because Array<T> does not conform to Equatable and will never conform to Equatable. 

Actually, now that I write it out, even that isn’t true. Somebody might retroactively add conformances after importing your library. In general, no public type knows the complete set of protocols it conforms to when it is compiled; it doesn’t matter if it’s a class or a value-type.

So there is some value in a generalised concrete-type existential even without worrying about conditional conformances.

- Karl


More information about the swift-evolution mailing list