Created
April 8, 2016 22:57
-
-
Save dduan/8b0dcbd484aaa7ff35807ec8c8819f3d to your computer and use it in GitHub Desktop.
Quiz time!
This file contains 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
func f<T, U>(x: T.Type, _ y: U) -> Bool { | |
return y is T | |
} | |
func g<T, U>(x: T, _ y: U) -> Bool { | |
return y is T | |
} | |
protocol P {} | |
class B: P {} | |
// what would be the output? | |
f(P.self, B()) | |
g(P.self, B()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment