Files
swift-mirror/lib/Sema/CSSimplify.cpp
Doug Gregor 2cea48a91d Unify ArrayDowncastExpr handling with ConditionalCheckedCastExpr handling.
The latter has some brilliant code to deal with differing levels of
optionality, binding inner optionals etc. Unifying these code paths
makes array downcasts work when the source has (possibly
implicitly-wrapped) optional type, e.g.,

var arrImplicitOpt: AnyObject[]! = nsarr
if let strArr = arrImplicitOpt as String[] {
  println("String array contains \(strArr)")
} else {
  println("Not a string array")
}

Another part of <rdar://problem/16952771> and the array-bridging story.


Swift SVN r18392
2014-05-19 05:14:39 +00:00

122 KiB