Skip to content
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

Consistent bridging for NSErrors at the language boundary #331

Closed
wants to merge 1 commit into from
Closed

Consistent bridging for NSErrors at the language boundary #331

wants to merge 1 commit into from

Conversation

CharlesJS
Copy link

No description provided.

@CharlesJS CharlesJS changed the title Create NNNN-consistent-NSError-bridging-at-language-boundary.md Consistent bridging for NSErrors handled in Swift May 17, 2016
@CharlesJS CharlesJS changed the title Consistent bridging for NSErrors handled in Swift Consistent bridging for NSErrors at the language boundary May 17, 2016
@lattner
Copy link
Collaborator

lattner commented May 20, 2016

This is a great direction to investigate, and we definitely need to make progress here. However, the proposal acknowledges that we really need to resolve more fundamental questions about the bridging story. Also, the improvements suggested are largely additive, so we can do them at any time.

As such, it is best to defer discussion of this area until this Fall for consideration in a post Swift 3.0 release. Thank you for writing this up!

@lattner lattner closed this May 20, 2016
@CharlesJS
Copy link
Author

CharlesJS commented May 20, 2016

Thanks for looking at my proposal. I would like to point out that although it is largely additive, it is not completely so; a small amount of code would be broken, including anything that explicitly constructs NSError objects and passes them to APIs that expect ErrorProtocols. Also, all of the explicit casts/conversions of Swift errors to NSError would need to be removed, as they would be unnecessary in the new regime. I do believe that the benefits would greatly outweigh the costs here, so if source compatibility is a major concern post-3.0, it may be better to look at this (and the associated bridging issues) sooner rather than later. If small code-breaking changes are still kosher post-3.0, however, then this is no problem, and I will resubmit the proposal in the fall, adjusted to fit whatever decisions are made regarding the bridging behavior. I assume the time to do that would be shortly after 3.0 is released?

Thanks,
Charles

@lattner
Copy link
Collaborator

lattner commented May 20, 2016

I understand your concern, but the reality is that this is a very large design effort. I'm pretty confident that we can roll out the benefit of this with either no source breakage, or opt-in breakage that can be staged over time. As plans for releases beyond Swift 3 are developed, we'll come up with a specific strategy. This isn't the only proposal in this situation.

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