   }
 #endif
 
-  public var _domain: String { return NSCocoaErrorDomain }
-  public var _code: Int { return rawValue }
-
-  public init?(rawValue: Int) {
-    self = unsafeBitCast(rawValue, _NSCocoaError.self)
-  }
-
-  public init?(_bridgedNSError: NSError) {
-    if _bridgedNSError.domain != NSCocoaErrorDomain {
-      return nil
-    }
-
-    if let result = _NSCocoaError(rawValue: _bridgedNSError.code) {
-      self = result
-    } else {
-      return nil
-    }
-  }
-}
-
-@objc public enum _NSURLError : Int, _ObjectiveCBridgeableErrorType {
+  public static var _NSErrorDomain: String { return NSCocoaErrorDomain }
+}
+
+/// Enumeration that describes the error codes within the NSURL error
+/// domain.
+@objc public enum _NSURLError : Int, _BridgedNSError {
   case Unknown = -1
   case Cancelled = -999
   case BadURL = -1000

  }
}

@objc public enum _NSCocoaError : Int, _ObjectiveCBridgeableErrorType {
  // Foundation errors
  case FileNoSuchFileError = 4
  case FileLockingError = 255

  @available(OSX, introduced=10.10) @available(iOS, introduced=8.0)
  case BackgroundSessionWasDisconnected = -997

  public static var _NSErrorDomain: String { return NSURLErrorDomain }
}
