Skip to content

[4.0] Upgrade the warning about non-escaping parameter exclusivity to an error #10991

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

Conversation

rjmccall
Copy link
Contributor

The restriction on the use of non-escaping closure parameters in SE-0176 was initially implemented as a warning even in Swift mode because it broke the Dispatch overlay. Dispatch has fixed their code (rdar://33065909, swiftlang/swift-corelibs-libdispatch#268), so we can now promote this to an error. It is important to promote it to an error in Swift 4 in order to make the basic exclusivity model as close as possible to what we want to commit to.

This is the swift-4.0-branch version of #10988. It is being tracked as rdar://33337020.

The patch turns a warning into an error, and only when compiling as Swift 4. Compiling as Swift 3 continues to be a warning.

The risk is low. It's possible that code will stop compiling, but only when code is being built as Swift 4, and only if the code was previously emitting a warning.

No additional testing beyond CI coverage has been performed.

@rjmccall
Copy link
Contributor Author

@swift-ci Please test.

@rjmccall
Copy link
Contributor Author

@devincoughlin or @atrick, would you mind reviewing?

@devincoughlin
Copy link
Contributor

Looks good to me for swift-4.0-branch.

@rjmccall rjmccall merged commit 7b57998 into swiftlang:swift-4.0-branch Jul 16, 2017
@rjmccall rjmccall deleted the noescape-exclusivity-restriction-is-an-error-4.0 branch July 16, 2017 23:50
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