Skip to content

Commit d4a7f3f

Browse files
committed
AST: Skip accessors in isDeclVisibleInLookupMode()
They never appear in completion or typo correction results, so we shouldn't waste time validating them.
1 parent 7cb6cd6 commit d4a7f3f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/AST/LookupVisibleDecls.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ static bool areTypeDeclsVisibleInLookupMode(LookupState LS) {
124124
static bool isDeclVisibleInLookupMode(ValueDecl *Member, LookupState LS,
125125
const DeclContext *FromContext,
126126
LazyResolver *TypeResolver) {
127+
// Accessors are never visible directly in the source language.
128+
if (isa<AccessorDecl>(Member))
129+
return false;
130+
127131
if (TypeResolver) {
128132
TypeResolver->resolveDeclSignature(Member);
129133
TypeResolver->resolveAccessControl(Member);

0 commit comments

Comments
 (0)