[swift-evolution] [Pitch][Bug?] Test for Anti-Conformance During Generics

Tino Heth 2th at gmx.de
Sun Jul 30 16:03:41 CDT 2017


> [Apologies if this is in Swift 4 already.]
> 
> We can have generic parameters match a protocol. But I have an idea in my head that involves the type NOT conforming to a protocol. I don’t think we have a way currently to work with this.
Why do you want that?
When something conforms, you know that you can call the methods of the protocol, but without conformance, you can't do anything that's not possible using "is".
Also:
Don't forget retroactive conformance — you can never rely on non-conformance.


More information about the swift-evolution mailing list