-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Fold exportability checking into availability checking #34329
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
slavapestov
merged 9 commits into
swiftlang:main
from
slavapestov:nuke-exportability-checker
Oct 20, 2020
Merged
Fold exportability checking into availability checking #34329
slavapestov
merged 9 commits into
swiftlang:main
from
slavapestov:nuke-exportability-checker
Oct 20, 2020
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
f7f4a70
to
3880658
Compare
@swift-ci Please smoke test |
@swift-ci Please test source compatibility |
3880658
to
462bf2a
Compare
@swift-ci Please smoke test |
@swift-ci Please test source compatibility |
462bf2a
to
de29cdd
Compare
@swift-ci Please smoke test |
Today, we check conformance exportability in two places: 1) For inlinable function bodies: in availability checking 2) For types in inlinable declaration signatures: in availability checking 3) For types in non-inlinable declaration signatures: in ExportabilityChecker I want to merge 2) and 3) together, and also generalize the conformance exportability check to check conformance availability as well. This is a preliminary refactoring towards achieving this goal.
Availability checking already knows how to check exportability for types and conformances referenced from inlinable function signatures and bodies. Let's generalize this to work on non-inlinable function signatures as well, allowing us to get rid of the ExportabilityChecker altogether.
…ailability checking The substitution map is checked elsewhere.
…lUnavailability()
…type The ExportContext describes the restrictions, if any, on what declarations can be uttered in a specific place in the program. Here, the place is either the signature of a declaration, or the body of a function.
Converting the innermost DeclContext into a Decl won't work if the innermost DeclContext is the parent context of a VarDecl. Instead, use the relevant bit of state from the ExportContext, which is computed correctly. This fixes a regression caused by an earlier commit in this PR which our test suite did not catch.
de29cdd
to
a824e5a
Compare
@swift-ci Please smoke test |
@swift-ci Please test source compatibility |
1 similar comment
@swift-ci Please test source compatibility |
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.
In the previous PR, I introduced DeclAvailabilityChecker. The division of labor was as follows:
This PR folds ExportabilityChecker into DeclAvailabilityChecker, merging the first two code paths, and prepares the availability checking code to look at conformance availability as well as conformance exportability.
Builds upon #34325.