Skip to content

Commit

Permalink
We only need to resolve accessibility to check accessibility.
Browse files Browse the repository at this point in the history
Complete declaration validation is massive overkill.

Swift SVN r32505
  • Loading branch information
DougGregor committed Oct 7, 2015
1 parent 3ba8b06 commit 40db77a
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/AST/ModuleNameLookup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,7 @@ static void lookupInModule(Module *module, Module::AccessPathTy accessPath,
auto newEndIter = std::remove_if(localDecls.begin(), localDecls.end(),
[=](ValueDecl *VD) {
if (typeResolver) {
// Do not resolve values in a type context - doing so could potentially
// lead to an infinitely recursive validation loop.
if ((resolutionKind != ResolutionKind::TypesOnly) ||
dyn_cast<TypeDecl>(VD)) {
typeResolver->resolveDeclSignature(VD);
}
typeResolver->resolveAccessibility(VD);
}
if (!VD->hasAccessibility())
return false;
Expand Down

0 comments on commit 40db77a

Please sign in to comment.