Skip to content

Allow @testable witnesses to satisfy protocol requirements. #4654

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

Conversation

jrose-apple
Copy link
Contributor

That is, if a would-be witness to a protocol requirement is only accessible because its module has been imported with @testable, consider that "good enough" to satisfy the rule that a witness must be available everywhere the protocol and conforming type are both available (because those other contexts could have done their own testable import, and also shouldn't have to know that this file needed one to conform to the protocol).

This re-enables some patterns that would have been allowed pre-SE-0025.

rdar://problem/28173654

That is, if a would-be witness to a protocol requirement is only
accessible because its module has been imported with '@testable',
consider that "good enough" to satisfy the rule that a witness
must be available everywhere the protocol and conforming type are
both available (because those other contexts /could/ have done their
own testable import).

rdar://problem/28173654
Inspired by the previous commit. These are things we expect to keep
working.
@jrose-apple
Copy link
Contributor Author

@jckarter, since I already talked through the problem with you, would you mind reviewing the fix?

@swift-ci Please test

@jckarter
Copy link
Contributor

jckarter commented Sep 7, 2016

Looks good.

@jrose-apple jrose-apple merged commit c85ea1f into swiftlang:master Sep 7, 2016
@jrose-apple jrose-apple deleted the testable-protocol-witnesses branch September 7, 2016 20:36
jrose-apple added a commit to jrose-apple/swift that referenced this pull request Sep 7, 2016
…witnesses

Allow @testable witnesses to satisfy protocol requirements.

rdar://problem/28173654
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