Last active
April 26, 2016 22:57
-
-
Save WanderingStar/06b3462e9cf976f6313a2ee381aaa544 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 A {} | |
class B: A { | |
let v: Int | |
init(v: Int) { self.v = v } | |
} | |
let arr = [B(v: 0), B(v: 1)] | |
let any: Any = arr | |
switch any { | |
case let ehs as [A]: | |
print("These are As: \(ehs)") | |
default: | |
print("Dunno") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I would like this to print "These are As"