🍒 Diagnose additional @objcImpl member mismatch errors #66149
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Cherry-pick of #66073 to release/5.9:
Explanation:
@_objcImplementation
checking currently does not diagnose some mismatches between the header and extension, such as using a method to implement a property or declaring the wrong types. This PR adds these checks, hopefully improving adopter code quality.Scope: Projects adopting
@_objcImplementation
in Swift 5.9, before the feature is official or fully stable.Issue: Fixes rdar://102063730
Risk: Very low. Thanks to #66113, the new diagnostics will be emitted as warnings, so newly-caught mistakes (or new regressions in the diagnostics!) will not prevent adopters from building their projects.
Testing: Includes unit tests; these verify that the new diagnostics are emitted as warnings in release/5.9.
Reviewer: Reviewed by @tshortli on main (except for the last commit, which only adjusts the tests for release/5.9).