-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[stdlib] _BridgedStoredNSError should conform to CustomStringConvertible #24149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Since it is a struct that wraps an NSError, it should map its `description` property to its internal NSError instance
_BridgedStoredNSError
should conform to CustomStringConvertible
@compnerd please test |
@@ -433,6 +433,12 @@ public protocol _BridgedStoredNSError : | |||
init(_nsError error: NSError) | |||
} | |||
|
|||
public extension _BridgedStoredNSError { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mind moving the conformance here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot due to compiler error, please check swiftlang/swift-corelibs-foundation#2140 (comment)
CC: @millenomi |
@swift-ci please test |
Build failed |
@swift-ci please test macOS platform |
Build failed |
The CI is buggy, it reports a failure but then clearly shows that it has identified 0 issues. |
@compnerd Can we marge without the macOS CI passing? The error only displays "No test results found.". I've also reviewed the console output and found no compilation error. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure this is ABI breaking and won't fly. Even though _BridgedNSError
is underscored, it's public. Even if we're willing to break the ABI for underscored things (and we probably aren't), adding this conformance transitively adds it to public non-underscored types such as CocoaError
, something we can't do post-ABI stability.
No, we cannot. |
Not sure why CI's not showing it properly, but the failure is in the console log. Looks like the failing test is https://github.com/apple/swift/blob/master/test/Runtime/demangleToMetadataObjC.swift#L101-L109 which is related to |
I can fix the unit test, but if we can't do this because of ABI stability, then there is no point then. |
Yes, unfortunately this is an ABI break. I'm going to close this out due to age and inactivity. Thank you for all your efforts thus far. |
Since it is a struct that wraps an NSError, it should map its
description
property to its internalNSError
instance.e.g.
"\(POSIXError(.E2BIG))"
Before:
POSIXError(_nsError: Error Domain=NSPOSIXErrorDomain Code=7 "Argument list too long")
Now:
Error Domain=NSPOSIXErrorDomain Code=7 "Argument list too long"