-
-
Save tarunon/d49e51937a242c01c8d7bfd57ae0e64a 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
[Int(1)] is [String] // false | |
[Int]() is [String] // true | |
[Int?.none] is [String] //false | |
[Int?.some(1)] is [String?] // false | |
[Int?.none] is [String?] // true | |
[Int(1)] as? [String] // nil | |
[Int]() as? [String] // [] | |
[Int?.none] as? [String] // nil | |
[Int?.some(1)] as? [String?] // nil | |
[Int?.none] as? [String?] // [nil] | |
let a1 = [Int?.none] as? [Int??] | |
let a2 = [Int?.none] as [Int??] | |
switch a1!.first! { | |
case .none: | |
print("come here") | |
case .some(.none): | |
fatalError() | |
case .some(.some): | |
fatalError() | |
} | |
switch a2.first! { | |
case .none: | |
fatalError() | |
case .some(.none): | |
print("come here") | |
case .some(.some): | |
fatalError() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment