mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Teach ASTScope how to reason about macro expansions. When we create an ASTScope for a source file that represents a macro expansion, its parent scope node is the macro expansion itself. When performing unqualified lookup (of any form), find the starting source file based on the location, not on the source file provided---this ensures that we start lookups within the macro expansion (for example). The effect of this is to enable macro expansions to work in nested contexts, where they refer to names in the scope in which the macro is expanded. This is decidedly unhiegenic, but it fits with our syntactic model.
6.2 KiB
6.2 KiB