Created
July 26, 2017 17:36
-
-
Save littlebobert/1db82e065b43d22b6b7aa4d8d5c44a17 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
protocol MyProtocol { | |
func foo() | |
} | |
class Parent { | |
func foo() { | |
print("parent") | |
} | |
} | |
extension MyProtocol { | |
func foo() { | |
print("extension") | |
} | |
} | |
class Child: Parent, MyProtocol { | |
} | |
let child = Child() | |
child.foo() // prints "parent" not "extension" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment