mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Rather than attempting Error bridging early when trying to dynamically cast to NSError or NSObject, treat it as the *last* thing we do when all else fails. Push most of this code over into Objective-C-specific handling rather than #ifdef'd into the main casting logic to make that slightly more clear. One oddity of Error/NSError bridging is that a class that conforms to Error can be dynamically cast to NSObject via Error bridging. This has always been known to the static compiler, but the runtime itself was not always handling such a cast uniformly. Do so now, uniformly. However, this forced us to weaken an assertion, because casting a class type to NSError or NSObject can produce an object with a different identity. Fixes rdar://problem/57393991.
11 KiB
11 KiB