• Nested Symbol & SymbolTable usages SymbolTable::getSymbolUsesdocumentationexplicitly says: This does not traverse into any nested symbol tables. • Correspondingcommitsays: this revision updates the user contract to never recurse into operations if they define a symbol table. • The current functionality, which does recurse, makes it difficult to examine the uses held by a symbol table itself. • Unfortunately, I didn’t find any related test to indicate why recursing intoSymbolTableoperations creates a problem. • Feel free to share a link if I missed it. • My assumption the reason can be seen in the following example: I assumecall @foo()on line6might be ambigious, as recursing intonested_symbol_tablewill recognize it as usage offoodefined on line2, while it’s actually a usage offooon line5.
Article Summaries:
- A recent commit clarified that
SymbolTable::getSymbolUseswill no longer recurse into operations that define nested symbol tables. The change was made because the existing recursive behavior made it hard to examine uses held by a symbol table itself. A developer highlighted a potential ambiguity: a call to@foo()inside a nested module could be incorrectly resolved to a symbol defined in the parent module if recursion were allowed. They also noted that whilegetSymbolUsescorrectly finds references in a parent region, it fails to locate references in a nested symbol table even when explicitly queried, revealing an inconsistency in traversal logic. The discussion seeks clarification and potential fixes.
Sources: