mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Introduce separately-imported stdlib overlays
The `_Concurrency` and `_StringProcessing` modules are implementation details of the standard library; to developers, their contents should behave as though they are declared directly within module `Swift`. This is the exact same behavior we expect of cross-import overlays, so treat these modules as though they are cross-import overlays with no bystanding module. Because these modules don’t re-export the standard library, it’s also necessary to treat `Swift` as a separately imported overlay of itself; do so and make that actually work.
This commit is contained in:
@@ -163,11 +163,18 @@ void ModuleNameLookup<LookupStrategy>::lookupInModule(
|
||||
moduleOrFile->getParentModule(), overlays);
|
||||
if (!overlays.empty()) {
|
||||
// If so, look in each of those overlays.
|
||||
for (auto overlay : overlays)
|
||||
lookupInModule(decls, overlay, accessPath, moduleScopeContext, options);
|
||||
bool selfOverlay = false;
|
||||
for (auto overlay : overlays) {
|
||||
if (overlay == moduleOrFile->getParentModule())
|
||||
selfOverlay = true;
|
||||
else
|
||||
lookupInModule(decls, overlay, accessPath, moduleScopeContext,
|
||||
options);
|
||||
}
|
||||
// FIXME: This may not work gracefully if more than one of these lookups
|
||||
// finds something.
|
||||
return;
|
||||
if (!selfOverlay)
|
||||
return;
|
||||
}
|
||||
|
||||
const size_t initialCount = decls.size();
|
||||
|
||||
Reference in New Issue
Block a user