mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Verify that _Concurrency *can* be imported on implicit import.
In case the compiler is used with concurrency features enabled (by-default or otherwise), and an older SDK is used which does not include the `_Concurrency` module, do not load this module implicitly. Instead, emit a diagnostic indicating that no such module is found. rdar://76967260
This commit is contained in:
@@ -1950,7 +1950,7 @@ bool ASTContext::shouldPerformTypoCorrection() {
|
||||
return NumTypoCorrections <= LangOpts.TypoCorrectionLimit;
|
||||
}
|
||||
|
||||
bool ASTContext::canImportModule(ImportPath::Element ModuleName) {
|
||||
bool ASTContext::canImportModuleImpl(ImportPath::Element ModuleName) const {
|
||||
// If this module has already been successfully imported, it is importable.
|
||||
if (getLoadedModule(ImportPath::Module::Builder(ModuleName).get()) != nullptr)
|
||||
return true;
|
||||
@@ -1966,10 +1966,22 @@ bool ASTContext::canImportModule(ImportPath::Element ModuleName) {
|
||||
}
|
||||
}
|
||||
|
||||
FailedModuleImportNames.insert(ModuleName.Item);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ASTContext::canImportModule(ImportPath::Element ModuleName) {
|
||||
if (canImportModuleImpl(ModuleName)) {
|
||||
return true;
|
||||
} else {
|
||||
FailedModuleImportNames.insert(ModuleName.Item);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool ASTContext::canImportModule(ImportPath::Element ModuleName) const {
|
||||
return canImportModuleImpl(ModuleName);
|
||||
}
|
||||
|
||||
ModuleDecl *
|
||||
ASTContext::getModule(ImportPath::Module ModulePath) {
|
||||
assert(!ModulePath.empty());
|
||||
|
||||
Reference in New Issue
Block a user