We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 51be7d1 commit b16c8d2Copy full SHA for b16c8d2
Sources/Foundation/NSError.swift
@@ -891,8 +891,8 @@ func _convertNSErrorToError(_ error: NSError?) -> Error {
891
892
public // COMPILER_INTRINSIC
893
func _convertErrorToNSError(_ error: Error) -> NSError {
894
- if let object = _extractDynamicValue(error as Any) {
895
- return unsafeDowncast(object, to: NSError.self)
+ if let object = _extractDynamicValue(error as Any), let asNS = object as? NSError {
+ return asNS
896
} else {
897
let domain: String
898
let code: Int
0 commit comments