Skip to content

[SR-3917] Allow missing witnesses for optional and unavailable requirements. #7886

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
Mar 3, 2017

Conversation

DougGregor
Copy link
Member

This is a bit of a hack to dodge an assertion. In essence, it's a
harmless hack, but we'd like to make the handling of optional and
unavailable requirements more rigorous.

Resolves SR-3917.

…ements.

This is a bit of a hack to dodge an assertion. In essence, it's a
harmless hack, but we'd like to make the handling of optional and
unavailable requirements more rigorous.
@DougGregor
Copy link
Member Author

@swift-ci please smoke test and merge

@DougGregor DougGregor requested a review from jrose-apple March 3, 2017 07:05
@@ -1997,7 +1997,8 @@ struct ASTNodeBase {};

if (auto req = dyn_cast<ValueDecl>(member)) {
if (!normal->hasWitness(req)) {
if (req->getAttrs().isUnavailable(Ctx) &&
if ((req->getAttrs().isUnavailable(Ctx) ||
req->getAttrs().hasAttribute<OptionalAttr>()) &&
Copy link
Contributor

Choose a reason for hiding this comment

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

Weird indentation

Copy link
Member Author

Choose a reason for hiding this comment

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

I've got some serious tabs going on, apparently. Will fix!

|| requirement->getAttrs().hasAttribute<OptionalAttr>()
|| requirement->getAttrs().isUnavailable(
requirement->getASTContext())) &&
"Conformance already complete?");
Copy link
Contributor

Choose a reason for hiding this comment

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

Weird indentation

@swift-ci swift-ci merged commit 5cef3fe into swiftlang:master Mar 3, 2017
@DougGregor DougGregor deleted the sr-3917 branch March 3, 2017 16:38
@jrose-apple
Copy link
Contributor

Looks good modulo Slava's indentation comments.

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