You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@gfontenot notes that nsNumber as UInt is still accepted, but will crash if nsNumber is a bridged object preserving a different Swift type. We should turn this into a conditional cast so that as? or as! has to be used. (We can maintain 3.0 compatibility by staging this in as a warning in Swift 3 mode.)
The text was updated successfully, but these errors were encountered:
Hm. It's not really about being multiply bridged; it's about being conditionally bridged. (It might not be worth making the distinction, but IIRC right now the only mapping from the reference type to the value type is the swift_bridge Clang attribute, and following that seems a bit overloaded.)
We must have this "conditionally bridgeable" concept in the compiler already to some degree, since an NSArray for instance can only conditionally be cast to Array<T> unless T is Any or AnyObject.
Additional Detail from JIRA
md5: 9b79ea739ac0ef094750ffdef09ccea7
Issue Description:
https://twitter.com/GFontenot/status/793611396487405568
@gfontenot notes that
nsNumber as UInt
is still accepted, but will crash ifnsNumber
is a bridged object preserving a different Swift type. We should turn this into a conditional cast so thatas?
oras!
has to be used. (We can maintain 3.0 compatibility by staging this in as a warning in Swift 3 mode.)The text was updated successfully, but these errors were encountered: