[IDE] Skip walking serialized non-visible extension decls

fec7a0b79b skipped all non-visible
`ValueDecls` but missed `ExtensionDecls`, which have the same issue.
Make sure to skip these too.

Resolves rdar://91279771.
This commit is contained in:
Ben Barham
2022-05-20 17:08:05 -07:00
parent de47a779c1
commit 4a4dded2fc
2 changed files with 34 additions and 0 deletions

View File

@@ -2923,10 +2923,18 @@ bool FileUnit::walk(ASTWalker &walker) {
!walker.shouldWalkSerializedTopLevelInternalDecls();
for (Decl *D : Decls) {
if (SkipInternal) {
// Ignore if the decl isn't visible
if (auto *VD = dyn_cast<ValueDecl>(D)) {
if (!VD->isAccessibleFrom(nullptr))
continue;
}
// Also ignore if the extended nominal isn't visible
if (auto *ED = dyn_cast<ExtensionDecl>(D)) {
auto *ND = ED->getExtendedNominal();
if (ND && !ND->isAccessibleFrom(nullptr))
continue;
}
}
#ifndef NDEBUG