Skip to content

[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

Closed

Conversation

colemancda
Copy link
Contributor

Since it is a struct that wraps an NSError, it should map its description property to its internal NSError 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"

Since it is a struct that wraps an NSError, it should map its
`description` property to its internal NSError instance
colemancda added a commit to colemancda/swift-corelibs-foundation that referenced this pull request Apr 19, 2019
@colemancda colemancda changed the title _BridgedStoredNSError should conform to CustomStringConvertible _BridgedStoredNSError should conform to CustomStringConvertible Apr 19, 2019
@colemancda colemancda changed the title _BridgedStoredNSError should conform to CustomStringConvertible [stdlib] _BridgedStoredNSError should conform to CustomStringConvertible Apr 19, 2019
@colemancda
Copy link
Contributor Author

@compnerd please test

@@ -433,6 +433,12 @@ public protocol _BridgedStoredNSError :
init(_nsError error: NSError)
}

public extension _BridgedStoredNSError {
Copy link
Member

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?

Copy link
Contributor Author

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)

@compnerd
Copy link
Member

CC: @millenomi

@compnerd
Copy link
Member

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 60e08ef

@compnerd
Copy link
Member

@swift-ci please test macOS platform

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 60e08ef

@colemancda
Copy link
Contributor Author

The CI is buggy, it reports a failure but then clearly shows that it has identified 0 issues.

@colemancda
Copy link
Contributor Author

@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.

@airspeedswift airspeedswift self-requested a review April 20, 2019 16:38
Copy link
Member

@airspeedswift airspeedswift left a 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.

@airspeedswift
Copy link
Member

Can we marge without the macOS CI passing?

No, we cannot.

@airspeedswift
Copy link
Member

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 NSError so likely related to this change.

@colemancda
Copy link
Contributor Author

I can fix the unit test, but if we can't do this because of ABI stability, then there is no point then.

@CodaFi
Copy link
Contributor

CodaFi commented Apr 14, 2020

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.

@CodaFi CodaFi closed this Apr 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants