Skip to content

Foundation API Conformance Update: Errors #581

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

Merged
merged 2 commits into from
Aug 23, 2016

Conversation

itaiferber
Copy link
Contributor

Changes

  • NSCocoaErrorCocoaError
  • Reimplement top-level error values in terms of consistent definitions
  • Import new error types (RecoverableError, LocalizedError) from overlay
  • Import URL errors and POSIX errors from overlay
  • Import error bridging from overlay
  • Update error code usage throughout project

@itaiferber
Copy link
Contributor Author

@swift-ci Please test

@itaiferber
Copy link
Contributor Author

@DougGregor Any thoughts/concerns about this change? I ported the NSError changes almost wholesale from the overlay (sans features requiring silgen and forms of bridging which are not present on Linux).

@itaiferber
Copy link
Contributor Author

Hmm. Looks like a serious compiler crash. Can't replicate on Linux myself, but looking into it.

@itaiferber
Copy link
Contributor Author

Perhaps there was a timing issue involved here. I want to see if re-testing makes any sort of difference. @swift-ci Please test

@itaiferber
Copy link
Contributor Author

itaiferber commented Aug 22, 2016

(For reference, the failure is still available to view here for the time being while CI re-runs)


extension NSError {
/// The "embedded" NSError is itself.
public func _getEmbeddedNSError() -> AnyObject? {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_getEmbeddedNSError isn't actually used when we don't have an Objective-C runtime, so you can remove this bit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Figured, but wasn't 100% sure (about this and about _GenericObjCError); will remove.

@itaiferber
Copy link
Contributor Author

itaiferber commented Aug 22, 2016

I doubt this will fix the CI build error, but it's worth a shot.

@itaiferber
Copy link
Contributor Author

@swift-ci Please test

@DougGregor
Copy link
Member

The compiler crash looks like we're trying to do some bridging without checking for ObjC interop.

@DougGregor
Copy link
Member

For reference, the rest of this PR looks good to me. Thank you!

@itaiferber
Copy link
Contributor Author

@DougGregor Figured; trying to diagnose, though haven't been able to reproduce on Linux yet, which will make testing expensive if I have to push to CI every time.

Thanks for the help!

@itaiferber
Copy link
Contributor Author

Pushed a change that might avoid the compilation crash we see here.

@itaiferber
Copy link
Contributor Author

@swift-ci Please test

@itaiferber
Copy link
Contributor Author

itaiferber commented Aug 23, 2016

Looks like that fixed the hashValue failure point; the only other location is isEqual. Hopefully this change will correct things.

@itaiferber
Copy link
Contributor Author

@swift-ci Please test

@itaiferber
Copy link
Contributor Author

Perfect. Avoiding the (missing) bridging by overriding NSObject methods avoids the silgen issue.

@itaiferber itaiferber merged commit a08e895 into swiftlang:master Aug 23, 2016
@itaiferber itaiferber deleted the pr-error branch August 23, 2016 21:33
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.

2 participants