Last active
February 28, 2017 22:06
-
-
Save an0/50610ded2d02ba400278 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
// Discussion: https://twitter.com/an0/status/644176341986856960 | |
["a": "a"] as? [String: Any] // warning: conditional cast from '[String : Any]' to '[String : Any]' always succeeds | |
let a: Any = ["a": "a"] | |
let b = a as? [String: String] | |
let c = a as? [String: AnyObject] | |
let d = a as? [String: Any] | |
if let b = b { | |
let e = b as? [String: Any] // error: '[String : String]' is not convertible to '[String : Any]' | |
} | |
if let c = c { | |
let f = c as? [String: Any] // error: '[String : AnyObject]' is not convertible to '[String : Any]' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment