Files
swift-mirror/lib/Sema/CSSimplify.cpp
Doug Gregor e7ad745be0 Support downcasting from AnyObject to a bridged value type.
This allows us to cast "through" a bridged class type in an "as" case,
e.g.,

  if let str = obj as String { ... }

where obj is an AnyObject (or optional/implicitly unwrapped optional
thereof). In such cases, we perform a checked cast to the
corresponding class type (NSString in this case) and then convert the
(optional!) result down to the value type.

Addresses the main part of <rdar://problem/15288553>, but we still
have trouble with "is" with optionals, and the #if false'd out
testcase incorrectly fails due to <rdar://problem/16953860>.

Swift SVN r18347
2014-05-18 20:30:39 +00:00

122 KiB