mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
When a “separately imported overlay” is added to a SourceFile, two things happen: 1. The direct import of the underlying module is removed from getImports*() by default. It is only visible if the caller passes ImportFilterKind:: ShadowedBySeparateOverlay. This means that non-module-scoped lookups will search _OverlayModule before searching its re-export UnderlyingModule, allowing it to shadow underlying declarations. 2. When you ask for lookupInModule() to look in the underlying module in that source file, it looks in the overlays instead. This means that UnderlyingModule.foo() can find declarations in _OverlayModule.
72 KiB
72 KiB