[swift-evolution] [Pitch] Requiring proactive overrides for default protocol implementations.

Matthew Johnson musical.matthew at mac.com
Wed Apr 27 15:12:27 CDT 2016



Sent from my iPad

> On Apr 27, 2016, at 3:08 PM, Jérôme ALVES via swift-evolution <swift-evolution at swift.org> wrote:
> 
> What if... 
> 
> FooBar.framework defines :
> public protocol A {
>     func foo()
> }
> public type B: A {
>     public func foo () { 
>           … implementation … 
>     }
> }
> 
> Other module defines :
> import FooBar
> extension A {
>     func foo() { .. default implementation … }
> }
> 

This is a good example.  More generally, we should be sure that any change we make here does not interfere with retroactive modeling.

> 
> Jérôme 
> 
>> Le 27 avr. 2016 à 19:10, Erica Sadun via swift-evolution <swift-evolution at swift.org> a écrit :
>> 
>> protocol A {
>>     func foo()
>> }
>> 
>> extension A {
>>     func foo() { .. default implementation … }
>> }
>> 
>> type B: A {
>> 
>>     override required func foo () { … overrides implementation … }
>> }
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160427/a2d1f319/attachment.html>


More information about the swift-evolution mailing list