Skip to content

Commit 67b3a80

Browse files
committed
_BridgedStoredNSError should conform to CustomStringConvertible
swiftlang/swift#24149
1 parent 0712fc9 commit 67b3a80

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Foundation/NSError.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ public protocol _BridgedNSError : __BridgedNSError, RawRepresentable, _Objective
498498

499499
/// Describes a bridged error that stores the underlying NSError, so
500500
/// it can be queried.
501-
public protocol _BridgedStoredNSError : __BridgedNSError, _ObjectiveCBridgeableError, CustomNSError, Hashable {
501+
public protocol _BridgedStoredNSError : __BridgedNSError, _ObjectiveCBridgeableError, CustomNSError, Hashable, CustomStringConvertible {
502502
/// The type of an error code.
503503
associatedtype Code: _ErrorCodeProtocol
504504

@@ -516,6 +516,12 @@ public protocol _BridgedStoredNSError : __BridgedNSError, _ObjectiveCBridgeableE
516516
init(_nsError error: NSError)
517517
}
518518

519+
public extension _BridgedStoredNSError {
520+
var description: String {
521+
return _nsError.description
522+
}
523+
}
524+
519525
/// Various helper implementations for _BridgedStoredNSError
520526
extension _BridgedStoredNSError where Code: RawRepresentable, Code.RawValue: FixedWidthInteger {
521527
public var code: Code {

0 commit comments

Comments
 (0)