Skip to content

Commit 60e08ef

Browse files
committed
_BridgedStoredNSError should conform to CustomStringConvertible
Since it is a struct that wraps an NSError, it should map its `description` property to its internal NSError instance
1 parent a58db50 commit 60e08ef

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

stdlib/public/Darwin/Foundation/NSError.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ extension _BridgedNSError where Self.RawValue: FixedWidthInteger {
417417
/// Describes a bridged error that stores the underlying NSError, so
418418
/// it can be queried.
419419
public protocol _BridgedStoredNSError :
420-
_ObjectiveCBridgeableError, CustomNSError, Hashable {
420+
_ObjectiveCBridgeableError, CustomNSError, Hashable, CustomStringConvertible {
421421
/// The type of an error code.
422422
associatedtype Code: _ErrorCodeProtocol, RawRepresentable
423423
where Code.RawValue: FixedWidthInteger
@@ -433,6 +433,12 @@ public protocol _BridgedStoredNSError :
433433
init(_nsError error: NSError)
434434
}
435435

436+
public extension _BridgedStoredNSError {
437+
var description: String {
438+
return _nsError.description
439+
}
440+
}
441+
436442
/// Various helper implementations for _BridgedStoredNSError
437443
extension _BridgedStoredNSError {
438444
public var code: Code {

0 commit comments

Comments
 (0)