Skip to content

Commit 4416152

Browse files
author
Itai Ferber
committed
Remove unnecessary NSError bridging code
1 parent f06a286 commit 4416152

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

Foundation/NSError.swift

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -344,14 +344,6 @@ public func _swift_Foundation_getErrorDefaultUserInfo(_ error: Error) -> Any? {
344344
// NSError and CFError conform to the standard Error protocol. Compiler
345345
// magic allows this to be done as a "toll-free" conversion when an NSError
346346
// or CFError is used as an Error existential.
347-
348-
extension NSError {
349-
/// The "embedded" NSError is itself.
350-
public func _getEmbeddedNSError() -> AnyObject? {
351-
return self
352-
}
353-
}
354-
355347
extension CFError : Error {
356348
public var _domain: String {
357349
return CFErrorGetDomain(self)._swiftObject
@@ -364,17 +356,6 @@ extension CFError : Error {
364356
public var _userInfo: Any? {
365357
return CFErrorCopyUserInfo(self) as Any
366358
}
367-
368-
/// The "embedded" NSError is itself.
369-
public func _getEmbeddedNSError() -> AnyObject? {
370-
return self
371-
}
372-
}
373-
374-
// An error value to use when an Objective-C API indicates error
375-
// but produces a nil error object.
376-
public enum _GenericObjCError : Error {
377-
case nilError
378359
}
379360

380361
/// An internal protocol to represent Swift error enums that map to standard
@@ -526,9 +507,6 @@ public extension _BridgedStoredNSError {
526507

527508
/// Implementation of CustomNSError for all _BridgedStoredNSErrors.
528509
public extension _BridgedStoredNSError {
529-
// FIXME: Would prefer to have a clear "extract an NSError
530-
// directly" operation.
531-
532510
static var errorDomain: String { return _nsErrorDomain }
533511

534512
var errorCode: Int { return _nsError.code }
@@ -566,11 +544,6 @@ extension _ErrorCodeProtocol where Self._ErrorType: _BridgedStoredNSError {
566544
}
567545

568546
extension _BridgedStoredNSError {
569-
/// Retrieve the embedded NSError from a bridged, stored NSError.
570-
public func _getEmbeddedNSError() -> AnyObject? {
571-
return _nsError
572-
}
573-
574547
public static func == (lhs: Self, rhs: Self) -> Bool {
575548
return lhs._nsError.isEqual(rhs._nsError)
576549
}

0 commit comments

Comments
 (0)