Created
February 25, 2016 19:52
-
-
Save ketzusaka/fc5019109b486c411a3d to your computer and use it in GitHub Desktop.
Any to Array of Any fail
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
| let items = [1, 2, 3] as Any | |
| if let items = items as? [Any] { // This cast fails | |
| print("it works") // and this is never printed | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment