Skip to content
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

[6.0] Rename ExtensionImportVisibility to MemberImportVisibility and fix bugs #73094

Conversation

tshortli
Copy link
Contributor

  • Explanation: Rename the ExtensionImportVisibility experimental feature to MemberImportVisibility. Although extension members are the members that are most often accidentally visible via transitive imports, the effects of enabling the feature are not limited to lookup of members on extensions. The test cases added in this PR provide examples of additional situations where these diagnostics will take effect. Also fixes some important bugs in the implementation of the feature.
  • Scope: Affects projects that specify -enable-experimental-feature MemberImportVisibility. These changes are proposed for inclusion in Swift 6.0 to facilitate evaluation of the feature's behavior for an upcoming language mode.
  • Issue/Radar: rdar://126491324, [SR-3908] Extension methods visible without importing module in a file #46493
  • Original PR: Rename ExtensionImportVisibility to MemberImportVisibility and fix bugs #73063
  • Risk: Low. Although this PR touches many files, execution of the majority of the new code is gated on enablement of the MemberImportVisibility feature.
  • Testing: Many test cases were added to exercise the feature. Real projects, including the standard library and other toolchain modules were built with MemberImportVisibility to evaluate the real world impact of the feature.
  • Reviewers: @xymus @DougGregor

This feature controls lookup behavior for members in general, not just
extension members.

Resolves rdar://126491324
- Reorganize test cases
- Add tests cases for multi-file and contextual base lookup
- Verify behavior without `MemberImportVisibility` feature

NFC.
Make sure suggested imports are consistent with imports in other files. Also,
make sure the underlying clang module is always imported `@_exported`.
This results in clearer source locations for diagnostics.
@tshortli tshortli requested a review from a team as a code owner April 17, 2024 22:47
@tshortli tshortli requested a review from nkcsgexi April 17, 2024 22:47
@tshortli tshortli added 🍒 release cherry pick Flag: Release branch cherry picks swift 6.0 labels Apr 17, 2024
@tshortli
Copy link
Contributor Author

@swift-ci please test

@tshortli tshortli enabled auto-merge April 17, 2024 23:20
@tshortli tshortli merged commit 1c97cc3 into swiftlang:release/6.0 Apr 18, 2024
5 checks passed
@tshortli tshortli deleted the rename-extension-import-visibility-feature-6.0 branch July 15, 2024 20:05
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.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants