On Apr 27, 2016, at 2:08 PM, Jérôme ALVES <[email protected]> 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 … }
> }
> 

Under these circumstances because of the mandatory import statement, there is 
no difference between the extension being defined in or outside the module, so 
long as the other module access is public. If it is not visible to the 
conforming protocol, there is no issue.

Conflicts of multiple protocol default implementations would need to be 
resolved exactly the same way as previously discussed, the only difference 
being namespacing:

required foo = OtherModule.A.foo

— E

> 
> Jérôme 
> 
> Le 27 avr. 2016 à 19:10, Erica Sadun via swift-evolution 
> <[email protected] <mailto:[email protected]>> 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
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to