The following should answer your question:protocol X { } extension X { func foo() { print(I'm an X foo) } } protocol Y { } extension Y { func foo() { print(I'm a Y foo) } } protocol Z { func foo() } struct Foo: Z, X, Y { }For your conveniece, is the playground output:Playground execution failed: /var/folders/rv/mwcdgk492x7g23_0byfwyjtw0000gn/T/./lldb/1444/playground261.swift:44:8: error: type 'Foo' does not conform to protocol 'Z' struct Foo: Z, X, Y ^ /var/folders/rv/mwcdgk492x7g23_0byfwyjtw0000gn/T/./lldb/1444/playground261.swift:41:10: note: multiple matching functions named 'foo()' with type '() -> ()' func foo() ^ /var/folders/rv/mwcdgk492x7g23_0byfwyjtw0000gn/T/./lldb/1444/playground261.swift:33:10: note: candidate exactly matches func foo() ^ /var/folders/rv/mwcdgk492x7g23_0byfwyjtw0000gn/T/./lldb/1444/playground261.swift:20:10: note: candidate exactly matches func foo() ^
Topic:
Programming Languages
SubTopic:
Swift
Tags: