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

Jérôme ALVES j.alves at me.com
Wed Apr 27 15:08:55 CDT 2016


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 … }
}


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 … }
> }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160427/219306f8/attachment.html>


More information about the swift-evolution mailing list