mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user