-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[5.9] Limit loading error when importing a module with package name built from interface #65854
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…has package-name. This disallows building an interface file that imports such module which should be allowed since interface does not contain package symbols unless usableFromInline or inlinable. This change limits erroring only when building a .swift file. Resolves rdar://108633068
@swift-ci smoke test |
@swift-ci smoke test |
213b117
to
192a97d
Compare
xymus
approved these changes
May 11, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good!
@swift-ci smoke test |
nkcsgexi
approved these changes
May 11, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, Ellie!
Ref: rdar://108945440
@swift-ci smoke test |
1 similar comment
@swift-ci smoke test |
@swift-ci test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 #65481 & #65855
Explanation: Previously a diagnostic was added to show an error when loading a module with package name if it was built from interface. It was expected if the file being built is a .swift file. If it's an interface, however, it should not throw an error (since interface files do not contain
package
symbols unless inlinable or usableFromInline). The change in this PR adds the check and was previously merged to main (Ref: rdar://108633068). This PR needs to be in 5.9 as it happens to fix a blocker for adoption of thepackage
access modifier: the error occurs during a build that runs api-digester which treats the source as an interface, leading to a build failure.Scope: Unblocks building Swift projects containing
package
access modifier that run api-digester.Issue: rdar://108945440
Risk: Low. The change is minimal as it checks the source kind before throwing an error.
Testing: Tests were added to ensure that it does not throw an error if the source kind is interface.
Reviewer: @xymus @tshortli @nkcsgexi