Skip to content

[Runtime] Extend ObjC bridging casts to convert NSError to Error when nested in a container type. #17515

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 1 commit into from
Jun 29, 2018

Conversation

mikeash
Copy link
Contributor

@mikeash mikeash commented Jun 26, 2018

rdar://problem/39349762

@millenomi
Copy link
Contributor

Can you double-check this works with the SCF implementation as well?

@mikeash
Copy link
Contributor Author

mikeash commented Jun 27, 2018

@millenomi Sure! Do we have any tests of error bridging for that currently? If not, is it just a matter of taking the bits of test/stdlib/ErrorBridged.swift that will run without ObjC and putting them in a file that doesn't require ObjC interop?

@mikeash
Copy link
Contributor Author

mikeash commented Jun 28, 2018

Answering my own question, SCF has its own NSError tests but doesn't cover this case. I added a test in this PR: swiftlang/swift-corelibs-foundation#1619

It passes so I think we're good!

@mikeash
Copy link
Contributor Author

mikeash commented Jun 28, 2018

@swift-ci please test

const Metadata *srcType,
const Metadata *destType,
DynamicCastFlags flags) {
auto CFErrorTypeID = SWIFT_LAZY_CONSTANT(CFErrorGetTypeID());
Copy link
Contributor

Choose a reason for hiding this comment

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

This appears to be unused.

… nested in a container type.

rdar://problem/39349762
@mikeash mikeash force-pushed the nested-nserror-to-error-bridging branch from 0b9cbfe to e992f46 Compare June 28, 2018 17:35
@mikeash
Copy link
Contributor Author

mikeash commented Jun 28, 2018

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 0b9cbfe082bc4acb069f393b2bd48302ded7ea80

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 0b9cbfe082bc4acb069f393b2bd48302ded7ea80

@mikeash mikeash merged commit e32b77a into swiftlang:master Jun 29, 2018
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.

4 participants