@@ -226,7 +226,7 @@ class UnqualifiedLookupFactory {
226
226
227
227
bool useASTScopesForExperimentalLookup () const ;
228
228
229
- void lookupNonlocalsInModuleScopeContext (DeclContext *);
229
+ void lookUpTopLevelNamesInModuleScopeContext (DeclContext *);
230
230
231
231
#pragma mark ASTScope-based-lookup declarations
232
232
@@ -435,7 +435,7 @@ void UnqualifiedLookupFactory::performUnqualifiedLookup() {
435
435
lookupNamesIntroducedBy (dcAndIsCascadingUse);
436
436
}
437
437
438
- void UnqualifiedLookupFactory::lookupNonlocalsInModuleScopeContext (
438
+ void UnqualifiedLookupFactory::lookUpTopLevelNamesInModuleScopeContext (
439
439
DeclContext *DC) {
440
440
// TODO: Does the debugger client care about compound names?
441
441
if (Name.isSimpleName () && DebugClient &&
@@ -601,7 +601,7 @@ void UnqualifiedLookupFactory::lookIntoDeclarationContextForASTScopeLookup(
601
601
// Lookup in the source file's scope marks the end.
602
602
if (isa<SourceFile>(scopeDC)) {
603
603
recordDependencyOnTopLevelName (scopeDC, Name, isCascadingUseResult);
604
- lookupNonlocalsInModuleScopeContext (scopeDC);
604
+ lookUpTopLevelNamesInModuleScopeContext (scopeDC);
605
605
return ;
606
606
}
607
607
@@ -702,10 +702,10 @@ void UnqualifiedLookupFactory::lookupInModuleScopeContext(
702
702
if (auto SF = dyn_cast<SourceFile>(dc))
703
703
lookForLocalVariablesIn (SF);
704
704
ifNotDoneYet ([&] {
705
- // TODO: figure out why this line is here, not unconditional, or after
706
- // lookupNonLocals .
705
+ // If no result has been found yet, the dependency must be on a top-level
706
+ // name, since up to now, the search has been for non-top-level names .
707
707
recordDependencyOnTopLevelName (dc, Name, isCascadingUse.getValueOr (true ));
708
- lookupNonlocalsInModuleScopeContext (dc);
708
+ lookUpTopLevelNamesInModuleScopeContext (dc);
709
709
});
710
710
}
711
711
0 commit comments