mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[ScanDependencies] Make sure canImport resolution agrees with import
Fix the problem that when the only module can be found is an invalid/out-of-date swift binary module, canImport and import statement can have different view for if the module can be imported or not. Now canImport will evaluate to false if the only module can be found for name is an invalid swiftmodule, with a warning with the path to the module so users will not be surprised by such behavior. rdar://128876895
This commit is contained in:
@@ -163,7 +163,7 @@ class ExplicitSwiftModuleLoader: public SerializedModuleLoaderBase {
|
||||
bool SkipBuildingInterface, bool IsFramework,
|
||||
bool IsTestableDependencyLookup = false) override;
|
||||
|
||||
bool canImportModule(ImportPath::Module named,
|
||||
bool canImportModule(ImportPath::Module named, SourceLoc loc,
|
||||
ModuleVersionInfo *versionInfo,
|
||||
bool isTestableDependencyLookup = false) override;
|
||||
|
||||
@@ -212,7 +212,7 @@ class ExplicitCASModuleLoader : public SerializedModuleLoaderBase {
|
||||
bool SkipBuildingInterface, bool IsFramework,
|
||||
bool IsTestableDependencyLookup = false) override;
|
||||
|
||||
bool canImportModule(ImportPath::Module named,
|
||||
bool canImportModule(ImportPath::Module named, SourceLoc loc,
|
||||
ModuleVersionInfo *versionInfo,
|
||||
bool isTestableDependencyLookup = false) override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user