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
Requestify scoped import validation #30038
Requestify scoped import validation #30038
Conversation
@swift-ci please test |
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.
Nice cleanup.
This can be used to retrieve the Swift module wrapper for a Clang submodule's top-level module.
188b99e
to
97837c1
Compare
@swift-ci please test |
@swift-ci please test source compatibility |
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.
Great cleanup. Only one question
97837c1
to
586559c
Compare
@swift-ci please test Windows platform |
@compnerd Mind triggering again? |
Move the validation of scoped imports into a request, and force the request when we're type-checking a primary file. This has the nice bonus of no longer running the validation for secondary files. The use of `ModuleDecl::getTopLevelModule` also allows us to correctly retrieve the top-level module for a Clang submodule, rather than potentially retrieving the Swift module in a mixed source project. Resolves SR-12265.
This was only required to represent an import that hadn't yet had its scope validated. Now that the validation has been requestified, we can directly record the resulting `ImportedModuleDesc` instead.
586559c
to
0c785aa
Compare
@swift-ci please smoke test |
@swift-ci please test Windows platform |
Move the lookup and validation of scoped imports into a request, and force the request when we're type-checking a primary file. This avoids having to do an additional pass during name binding, and has the nice bonus of no longer running the validation for secondary files.
This PR also adds
ModuleDecl::getTopLevelModule
, and uses it for the lookup of the scoped import rather than attempting to retrieve a module with the same name as the top-level module. This allows us to correctly retrieve the top-level module for a Clang submodule, rather than potentially retrieving the Swift module in a mixed source project.Resolves SR-12265.