Yes, there’s already logic to detect and diagnose this case in fact (@objc 
protocols are self-conforming, except when they contain static members or 
initializers).

Slava

> On Jan 18, 2017, at 12:10 AM, Anton Zhilin via swift-evolution 
> <[email protected]> wrote:
> 
> There is also a caveat with static members:
> 
> protocol P {
>     static func foo()
> }
> 
> struct S : P {
>     static func foo() { }
> }
> 
> func bar<T: P>(x: T) {
>     T.foo()
> }
> 
> let p = S() as P
> bar(p)  // P.foo() does not exist
> _______________________________________________
> swift-evolution mailing list
> [email protected]
> https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to