Skip to content

Commit f152885

Browse files
Fix ModuleDecl::getDisplayDecls for recursive case.
Ensure recursive calls to `ModuleDecl::getDisplayDecls` does not result in double collection of display decls.
1 parent d960101 commit f152885

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/AST/Module.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1567,14 +1567,15 @@ void ModuleDecl::getDisplayDecls(SmallVectorImpl<Decl*> &Results, bool Recursive
15671567
if (Recursive) {
15681568
ImportCollector importCollector;
15691569
this->getDisplayDeclsRecursivelyAndImports(Results, importCollector);
1570+
} else {
1571+
// FIXME: Should this do extra access control filtering?
1572+
FORWARD(getDisplayDecls, (Results));
15701573
}
1571-
// FIXME: Should this do extra access control filtering?
1572-
FORWARD(getDisplayDecls, (Results));
15731574
}
15741575

15751576
void ModuleDecl::getDisplayDeclsRecursivelyAndImports(
15761577
SmallVectorImpl<Decl *> &results, ImportCollector &importCollector) const {
1577-
this->getDisplayDecls(results);
1578+
this->getDisplayDecls(results, /*Recursive=*/false);
15781579

15791580
// Look up imports recursively.
15801581
collectExportedImports(this, importCollector);

0 commit comments

Comments
 (0)