Last active
September 3, 2015 07:03
-
-
Save Kametrixom/437a607e16eacf08e9c1 to your computer and use it in GitHub Desktop.
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
// Make this code compile without changing these lines | |
func raw<T: RawRepresentable>(t: T) -> T.RawValue { | |
return t.rawValue | |
} | |
let array : [E] = [.A(true), .B(1), .C("C")] | |
array.map(raw) | |
if case .C(let s?)? = array.first {} | |
// If you want a bigger challenge, include this part: | |
for elem in array { | |
switch elem { | |
case .C(_): | |
print("C!") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Congrats to @kostiakoval for solving the challenge when there wasn't an extended version yet
Congrats to @pyrtsa for solving the extended challenge ;)