Created
September 20, 2016 17:34
-
-
Save chadaustin/3cae9eae9e837329ff8049450a088cfe 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
protocol P { | |
func go() | |
} | |
extension String: P { | |
func go() { | |
print("String") | |
} | |
} | |
extension Int: P { | |
func go() { | |
print("Int") | |
} | |
} | |
func concrete<T: P>(_ a: T) { | |
a.go() | |
} | |
func abstract(a: P) { | |
concrete(a) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment