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

Robert Bennett rltbennett at icloud.com
Sun Jul 30 16:23:46 CDT 2017

This has come up before (aside: I can’t wait for a real forum because of exactly this; it would be great if we had a StackOverflow-like feature where the subject of your post would be searched against past threads to see if it’s a duplicate, or at least to allow you to go back and see where the conversation should pick up from) and the justification given was to resolve ambiguities arising from multiple protocol extensions each providing default implementations with the same signature, especially when the signatures use Self.

> On Jul 30, 2017, at 5:03 PM, Tino Heth via swift-evolution <swift-evolution at swift.org> wrote:
>> [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.
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution

More information about the swift-evolution mailing list