Report cannot load submodule if only able to load top module

For loaders that don't support loading submodules, canImportModule should report false instead of checking if can import top module.
This commit is contained in:
Apollo Zhu
2022-01-08 18:11:43 -08:00
parent 16d204bc51
commit 1f77f46e4f
3 changed files with 9 additions and 3 deletions

View File

@@ -1849,6 +1849,8 @@ bool ExplicitSwiftModuleLoader::canImportModule(ImportPath::Module path,
llvm::VersionTuple version,
bool underlyingVersion) {
// FIXME: Swift submodules?
if (path.hasSubmodule())
return false;
ImportPath::Element mID = path.front();
// Look up the module with the real name (physical name on disk);
// in case `-module-alias` is used, the name appearing in source files