[swift-evolution] Protocol non-conformance clause
Thorsten Seitz
tseitz42 at icloud.com
Sun May 1 16:24:15 CDT 2016
> Am 01.05.2016 um 03:03 schrieb Erica Sadun <erica at ericasadun.com>:
>
>
>> On Apr 29, 2016, at 3:18 PM, Thorsten Seitz <tseitz42 at icloud.com <mailto:tseitz42 at icloud.com>> wrote:
>>
>>
>>> Am 29.04.2016 um 19:51 schrieb Xiaodi Wu <xiaodi.wu at gmail.com <mailto:xiaodi.wu at gmail.com>>:
>>>
>>> Yes, certainly this works today. The motivation for Erica's question is that this would not work without modifying the third-party code if keywords were required to indicate implementation of protocol requirements.
>>
>> If I understood the motivation correctly, the requirements should protect against typos where I planned to *replace* a method but due to a typo instead created a new method and inherited the default (or superclass) implementation.
>
> extension A where !x:B {
> ....
> }
>
>
> then conforming a type to A and B would exclude the type from inheriting the extension.
I still don’t see the need for that. As my code example demonstrated an extension will not override an existing method in a conforming type and my other mail demonstrated that it is not necessary to have „required“ keywords in existing code which is extended.
Maybe I still haven’t understood the use case you are trying to solve. In that case I’d appreciate if you would give a complete example that shows what should happen why.
-Thorsten
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160501/000d761a/attachment.html>
More information about the swift-evolution
mailing list