Skip to content

Commit b85468d

Browse files
authored
add conflict resolution
var _code: Int { get } from CustomNSError and RawRepresentable conflict with each other
1 parent 6a6a5ad commit b85468d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Foundation/NSError.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,13 +296,23 @@ extension CustomNSError where Self: RawRepresentable, Self.RawValue: SignedInteg
296296
public var errorCode: Int {
297297
return numericCast(self.rawValue)
298298
}
299+
300+
// conflict resolution
301+
var _code: Int {
302+
return errorCode
303+
}
299304
}
300305

301306
extension CustomNSError where Self: RawRepresentable, Self.RawValue: UnsignedInteger {
302307
// The error code of Error with integral raw values is the raw value.
303308
public var errorCode: Int {
304309
return numericCast(self.rawValue)
305310
}
311+
312+
// conflict resolution
313+
var _code: Int {
314+
return errorCode
315+
}
306316
}
307317

308318
public extension Error where Self : CustomNSError {

0 commit comments

Comments
 (0)