[Sema] Support -testable-import-module to load transitive non-public dependencies

When using the -testable-import-module argument to insert a testable
import, there's no ImportDecl on which to show the diagnostics when
loading transitive dependencies. Clean up the logic to still load
dependencies in such a case.
This commit is contained in:
Alexis Laferrière
2023-03-29 11:32:28 -07:00
parent f7f69c6ae1
commit 9e18563faf
2 changed files with 7 additions and 5 deletions

View File

@@ -1479,10 +1479,9 @@ void SerializedASTFile::loadDependenciesForTestable(SourceLoc diagLoc) const {
File.loadDependenciesForFileContext(this, diagLoc, /*forTestable=*/true);
if (status != serialization::Status::Valid) {
if (diagLoc)
serialization::diagnoseSerializedASTLoadFailureTransitive(
getASTContext(), diagLoc, status, &File,
getParentModule()->getName(), /*forTestable*/true);
serialization::diagnoseSerializedASTLoadFailureTransitive(
getASTContext(), diagLoc, status, &File,
getParentModule()->getName(), /*forTestable*/true);
}
}