mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Update validation tests for id-as-Any.
This commit is contained in:
@@ -31,9 +31,11 @@ struct ErrorAsNSErrorRaceTest : RaceTestWithPerTrialData {
|
||||
let ns = raceData.error as NSError
|
||||
// Use valueForKey to bypass bridging, so we can verify that the identity
|
||||
// of the unbridged NSString object is stable.
|
||||
let domainInt: Int = unsafeBitCast(ns.value(forKey: "domain"), to: Int.self)
|
||||
let domainInt: Int = unsafeBitCast(ns.value(forKey: "domain").map { $0 as AnyObject },
|
||||
to: Int.self)
|
||||
let code: Int = ns.code
|
||||
let userInfoInt: Int = unsafeBitCast(ns.value(forKey: "userInfo"), to: Int.self)
|
||||
let userInfoInt: Int = unsafeBitCast(ns.value(forKey: "userInfo").map { $0 as AnyObject },
|
||||
to: Int.self)
|
||||
return Observation3Int(domainInt, code, userInfoInt)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user