Skip to content

[6.2] AST: Filter out some Obj-C overrides when MemberImportVisibility is enabled #81090

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 Apr 25, 2025

  • Explanation: Unlike in Swift, Obj-C allows method overrides to be declared in extensions (categories), even outside of the module that defines the type that is being extended. When MemberImportVisibility is enabled, these overrides must be filtered out to prevent them from hijacking name lookup and causing the compiler to insist that the module that defines the extension be imported.
  • Scope: Code compiled with MemberImportVisibility enabled.
  • Issue/Radar: rdar://145329988
  • Original PR: AST: Filter out some Obj-C overrides when MemberImportVisibility is enabled #81089
  • Risk: Low, should only cause previously rejected code to be accepted.
  • Testing: New compiler test cases.
  • Reviewer: @nkcsgexi

…nabled.

Unlike in Swift, Obj-C allows method overrides to be declared in extensions
(categories), even outside of the module that defines the type that is being
extended. When MemberImportVisibility is enabled, these overrides must be
filtered out to prevent them from hijacking name lookup and causing the
compiler to insist that the module that defines the extension be imported.

Resolves rdar://145329988.
@tshortli tshortli requested a review from a team as a code owner April 25, 2025 04:28
@tshortli
Copy link
Contributor Author

@swift-ci please test

@tshortli tshortli force-pushed the member-import-visibility-objc-overloads-in-extensions-take-2-6.2 branch from bda5991 to 4f61908 Compare April 25, 2025 05:57
@tshortli
Copy link
Contributor Author

@swift-ci please test

@tshortli tshortli enabled auto-merge April 25, 2025 05:58
@tshortli tshortli merged commit 8823a3f into swiftlang:release/6.2 Apr 25, 2025
5 checks passed
@tshortli tshortli added 🍒 release cherry pick Flag: Release branch cherry picks swift 6.2 labels Apr 25, 2025
@tshortli tshortli deleted the member-import-visibility-objc-overloads-in-extensions-take-2-6.2 branch April 25, 2025 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 6.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants