Skip to content

Instantly share code, notes, and snippets.

@littlebobert
Created July 26, 2017 17:36
Show Gist options
  • Save littlebobert/1db82e065b43d22b6b7aa4d8d5c44a17 to your computer and use it in GitHub Desktop.
Save littlebobert/1db82e065b43d22b6b7aa4d8d5c44a17 to your computer and use it in GitHub Desktop.
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