mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Index] Use access level to check decls to include
`isAccessibleFrom` has special handling for `@_objcImplementation` members, which causes the definition in Swift to be missed. Use access level directly rather than passing `nullptr` into `isAccessibleFrom`.
This commit is contained in:
@@ -3467,14 +3467,14 @@ bool FileUnit::walk(ASTWalker &walker) {
|
||||
if (SkipInternal) {
|
||||
// Ignore if the decl isn't visible
|
||||
if (auto *VD = dyn_cast<ValueDecl>(D)) {
|
||||
if (!VD->isAccessibleFrom(nullptr))
|
||||
if (VD->getFormalAccess() < AccessLevel::Public)
|
||||
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))
|
||||
if (ND && ND->getFormalAccess() < AccessLevel::Public)
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user