Skip to content

Proposal: Improve Crash-Safety when Importing Objective-C Code Without Nullability Attributes (former: Import as Optional by Default) #61

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
wants to merge 1 commit into from

Conversation

fabb
Copy link

@fabb fabb commented Dec 15, 2015

This proposal was discussed before on the swift-evolution mailing list with the topic Improve Crash-Safety when Importing Objective-C Code Without Nullability Attributes. Most of the feedback was positive.

In the proposal, 2 solutions are presented. As there has not yet been enough feedback on which solution was to prefer, I thought it was best to put them both into one proposal and have the reviewers decide.

I can be contacted via the swift-evolution mailing list, or comments on this pull request.
https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20151207/001054.html

Looking forward to the review! :-)

@radex
Copy link
Contributor

radex commented Dec 15, 2015

IMHO it would be a good idea to squash those commits — having 15 commits for a single thing gets noisy in git history.

@DougGregor
Copy link
Member

Yes, please squash this.

@fabb fabb force-pushed the import_as_optional_by_default branch from ec898e3 to f7da78b Compare December 16, 2015 07:58
@fabb
Copy link
Author

fabb commented Dec 16, 2015

Ok done, squashed and rebased on master.

@fabb fabb force-pushed the import_as_optional_by_default branch from f7da78b to 8af000b Compare December 16, 2015 09:04
@fabb fabb changed the title Import as Optional by Default Proposal: Improve Crash-Safety when Importing Objective-C Code Without Nullability Attributes (former: Import as Optional by Default) Dec 17, 2015
@fabb fabb force-pushed the import_as_optional_by_default branch from 8af000b to cb49150 Compare January 21, 2016 07:31
@fabb
Copy link
Author

fabb commented Jan 21, 2016

Ok, seems like when squashing/rebasing commits, code reviews get lost here on github, so I'll rather avoid squashing/rebasing.

@DougGregor
Copy link
Member

The core team has discussed this, and we are going to close this pull request. For one, a specific proposal should be just that: one specific proposal. The public review isn't to decide among alternatives, it is to evaluate a complete design. In this case, neither solution is acceptable:

Solution #1 introduces a significant burden on programmers that use non-nullability-annotated C and Objective-C APIs. Implicitly unwrapped optionals were introduced precisely because non-nullability-annotated C and Objective-C APIs are prevalent (and will continue to be so for many years), and the cost of turning all of the implicitly-unwrapped optionals into true optionals (in terms of extra if-lets, !'s, etc.) is significant.

Solution #2 is asking for a warning, which is outside the scope of the Swift evolution process.

@DougGregor DougGregor closed this Jan 29, 2016
@fabb
Copy link
Author

fabb commented Jan 30, 2016

The follow-up compiler feature request for adding warnings can be found here: https://bugs.swift.org/browse/SR-104

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.

3 participants