File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -422,7 +422,19 @@ ModuleDependenciesCache::ModuleDependenciesCache(
422
422
Optional<const ModuleDependencyInfo*>
423
423
ModuleDependenciesCache::findDependency (
424
424
StringRef moduleName, Optional<ModuleDependencyKind> kind) const {
425
- return globalScanningService.findDependency (moduleName, kind);
425
+ auto optionalDep = globalScanningService.findDependency (moduleName, kind);
426
+ // During a scan, only produce the cached source module info for the current module
427
+ // under scan.
428
+ if (optionalDep.hasValue ()) {
429
+ auto dep = optionalDep.getValue ();
430
+ if (dep->getAsSwiftSourceModule () &&
431
+ moduleName != mainScanModuleName &&
432
+ moduleName != " DummyMainModuleForResolvingCrossImportOverlays" ) {
433
+ return None;
434
+ }
435
+ }
436
+
437
+ return optionalDep;
426
438
}
427
439
428
440
bool ModuleDependenciesCache::hasDependency (
You can’t perform that action at this time.
0 commit comments