@@ -249,17 +249,18 @@ public func _stdlib_bridgeNSErrorToErrorProtocol<
249
249
250
250
/// Helper protocol for _BridgedNSError, which used to provide
251
251
/// default implementations.
252
- public protocol __BridgedNSError : RawRepresentable , ErrorProtocol {
252
+ public protocol __BridgedNSError : ErrorProtocol {
253
253
static var _nsErrorDomain : String { get }
254
254
}
255
255
256
256
// Allow two bridged NSError types to be compared.
257
257
public func == < T: __BridgedNSError > ( lhs: T , rhs: T ) -> Bool
258
- where T. RawValue: SignedInteger {
258
+ where T: RawRepresentable , T . RawValue: SignedInteger {
259
259
return lhs. rawValue. toIntMax ( ) == rhs. rawValue. toIntMax ( )
260
260
}
261
261
262
- public extension __BridgedNSError where RawValue: SignedInteger {
262
+ public extension __BridgedNSError
263
+ where Self: RawRepresentable , Self. RawValue: SignedInteger {
263
264
public final var _domain : String { return Self . _nsErrorDomain }
264
265
public final var _code : Int { return Int ( rawValue. toIntMax ( ) ) }
265
266
@@ -280,12 +281,13 @@ public extension __BridgedNSError where RawValue: SignedInteger {
280
281
281
282
// Allow two bridged NSError types to be compared.
282
283
public func == < T: __BridgedNSError > ( lhs: T , rhs: T ) -> Bool
283
- where T. RawValue: UnsignedInteger {
284
+ where T: RawRepresentable , T . RawValue: UnsignedInteger {
284
285
return lhs. rawValue. toUIntMax ( ) == rhs. rawValue. toUIntMax ( )
285
286
}
286
287
287
288
288
- public extension __BridgedNSError where RawValue: UnsignedInteger {
289
+ public extension __BridgedNSError
290
+ where Self: RawRepresentable , Self. RawValue: UnsignedInteger {
289
291
public final var _domain : String { return Self . _nsErrorDomain }
290
292
public final var _code : Int {
291
293
return Int ( bitPattern: UInt ( rawValue. toUIntMax ( ) ) )
@@ -312,14 +314,14 @@ public extension __BridgedNSError where RawValue: UnsignedInteger {
312
314
/// This protocol is used primarily to generate the conformance to
313
315
/// _ObjectiveCBridgeableErrorProtocol for such an enum.
314
316
public protocol _BridgedNSError : __BridgedNSError ,
317
+ RawRepresentable ,
315
318
_ObjectiveCBridgeableErrorProtocol ,
316
319
Hashable {
317
320
/// The NSError domain to which this type is bridged.
318
321
static var _nsErrorDomain : String { get }
319
322
}
320
323
321
- /// Enumeration that describes the error codes within the Cocoa error
322
- /// domain.
324
+ /// Describes errors within the Cocoa error domain.
323
325
public struct NSCocoaError : RawRepresentable , _BridgedNSError {
324
326
public let rawValue : Int
325
327
0 commit comments