Reintroduce NameLookupFlags::IgnoreNewExtensions

Soft revert a09382c. It should now be safe to add this flag back as an optimization to specifically disable lazy member loading instead of all extension loading.

Push the flag back everywhere it was needed, but also push it into lookup for associated type members which will never appear in extensions.
This commit is contained in:
Robert Widmann
2020-01-02 10:50:07 -08:00
parent 26d8bad7c2
commit b09c9957ad
6 changed files with 27 additions and 14 deletions

View File

@@ -4648,7 +4648,8 @@ ValueDecl *ProtocolDecl::getSingleRequirement(DeclName name) const {
}
AssociatedTypeDecl *ProtocolDecl::getAssociatedType(Identifier name) const {
auto results = const_cast<ProtocolDecl *>(this)->lookupDirect(name);
const auto flags = NominalTypeDecl::LookupDirectFlags::IgnoreNewExtensions;
auto results = const_cast<ProtocolDecl *>(this)->lookupDirect(name, flags);
for (auto candidate : results) {
if (candidate->getDeclContext() == this &&
isa<AssociatedTypeDecl>(candidate)) {