[Index] Don't index non-public imported declarations (#25865)

Apart from mildly speeding up indexing, this also keeps the compiler
from running into issues with implementation-only imports that may not
be present while we're trying to index.

rdar://problem/52083709
This commit is contained in:
Jordan Rose
2019-06-28 16:57:29 -07:00
committed by GitHub
parent 038c4f3e85
commit 02e1a11e35
9 changed files with 104 additions and 27 deletions

View File

@@ -2961,7 +2961,7 @@ getAccessScopeForFormalAccess(const ValueDecl *VD,
if (resultDC->isLocalContext() || access == AccessLevel::Private)
return AccessScope(resultDC, /*private*/true);
if (auto enclosingNominal = dyn_cast<NominalTypeDecl>(resultDC)) {
if (auto enclosingNominal = dyn_cast<GenericTypeDecl>(resultDC)) {
auto enclosingAccess =
getAdjustedFormalAccess(enclosingNominal, useDC,
treatUsableFromInlineAsPublic);