So I was trying to do
let foo = dict[\"key\"] as? String ?? \"empty\" var bar = some_func(string: foo!)
and XCode 6 complains that Op
Op
Your foo will be a String not a String? because the nil coalescing operator ?? will either unwrap your conditional cast if it is .some (resulting in a String) or it will use "empty", which is also a String.
foo
String
String?
??
.some
"empty"