Re-implement isInvalid for ValueDecls

This commit is contained in:
Robert Widmann
2019-10-21 17:43:04 -07:00
parent 41d099bc91
commit 4996858c4d
23 changed files with 98 additions and 80 deletions

View File

@@ -212,14 +212,15 @@ void SourceLookupCache::addToUnqualifiedLookupCache(Range decls,
if (!NTD->hasUnparsedMembers() || NTD->maybeHasOperatorDeclarations())
addToUnqualifiedLookupCache(NTD->getMembers(), true);
// Avoid populating the cache with the members of invalid extension
// declarations. These members can be used to point validation inside of
// a malformed context.
if (D->isInvalid()) continue;
if (auto *ED = dyn_cast<ExtensionDecl>(D)) {
// Avoid populating the cache with the members of invalid extension
// declarations. These members can be used to point validation inside of
// a malformed context.
if (ED->isInvalid()) continue;
if (auto *ED = dyn_cast<ExtensionDecl>(D))
if (!ED->hasUnparsedMembers() || ED->maybeHasOperatorDeclarations())
addToUnqualifiedLookupCache(ED->getMembers(), true);
}
}
}