Skip to content

Sema: Skip missing async requirements of Obj-C protocols consistently #72178

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

tshortli
Copy link
Contributor

@tshortli tshortli commented Mar 8, 2024

Requirements of Obj-C protocols that take a completion handler get imported with an async sibling requirement which can be fulfilled instead. Exactly one of these two requirements should be fulfilled. When resolving value witnesses ad-hoc, the compiler would only skip diagnosing a missing witness of an async requirement if the sibling requirement were fulfilled and there were zero viable matches. It shouldn't matter how many viable matches there are, though, since the alternative requirement is already witnessed.

There is no test case yet because when this problem reproduces, an assertion about resolving a witness after conformance checking is "complete" fails. A more significant overhaul of this logic should come later, but short-term we must fix source compatibility.

Resolves rdar://124145619

Requirements of Obj-C protocols that take a completion handler get imported
with an `async` sibling requirement which can be fulfilled instead. Exactly
one of these two requirements should be fulfilled. When resolving value
witnesses ad-hoc, the compiler would only skip diagnosing a missing witness of
an async requirement if the sibling requirement were fulfilled and there were
zero viable matches. It shouldn't matter how many viable matches there are,
though, since the alternative requirement is already witnessed.

There is no test case yet because when this problem reproduces, an assertion
about resolving a witness after conformance checking is "complete" fails. A
more significant overhaul of this logic should come later, but short-term we
must fix source compatibility.

Resolves rdar://124145619
@tshortli
Copy link
Contributor Author

tshortli commented Mar 8, 2024

@swift-ci please smoke test

@tshortli tshortli merged commit 8c5f44f into swiftlang:main Mar 8, 2024
@tshortli tshortli deleted the suppress-objc-async-sibling-missing-witness-diags branch March 8, 2024 15:16
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.

1 participant