@@ -1613,14 +1613,16 @@ bool DeclContext::lookupQualified(ModuleDecl *module, DeclName member,
1613
1613
bool isLookupCascading;
1614
1614
configureLookup (this , options, tracker, isLookupCascading);
1615
1615
1616
+ auto kind = (options & NL_OnlyTypes
1617
+ ? ResolutionKind::TypesOnly
1618
+ : ResolutionKind::Overloadable);
1616
1619
auto topLevelScope = getModuleScopeContext ();
1617
1620
if (module == topLevelScope->getParentModule ()) {
1618
1621
if (tracker) {
1619
1622
recordLookupOfTopLevelName (topLevelScope, member, isLookupCascading);
1620
1623
}
1621
1624
lookupInModule (module , /* accessPath=*/ {}, member, decls,
1622
- NLKind::QualifiedLookup, ResolutionKind::Overloadable,
1623
- topLevelScope);
1625
+ NLKind::QualifiedLookup, kind, topLevelScope);
1624
1626
} else {
1625
1627
// Note: This is a lookup into another module. Unless we're compiling
1626
1628
// multiple modules at once, or if the other module re-exports this one,
@@ -1633,8 +1635,7 @@ bool DeclContext::lookupQualified(ModuleDecl *module, DeclName member,
1633
1635
if (import .second != module )
1634
1636
return true ;
1635
1637
lookupInModule (import .second , import .first , member, decls,
1636
- NLKind::QualifiedLookup, ResolutionKind::Overloadable,
1637
- topLevelScope);
1638
+ NLKind::QualifiedLookup, kind, topLevelScope);
1638
1639
// If we're able to do an unscoped lookup, we see everything. No need
1639
1640
// to keep going.
1640
1641
return !import .first .empty ();
@@ -1644,10 +1645,6 @@ bool DeclContext::lookupQualified(ModuleDecl *module, DeclName member,
1644
1645
llvm::SmallPtrSet<ValueDecl *, 4 > knownDecls;
1645
1646
decls.erase (std::remove_if (decls.begin (), decls.end (),
1646
1647
[&](ValueDecl *vd) -> bool {
1647
- // If we're performing a type lookup, skip non-types.
1648
- if ((options & NL_OnlyTypes) && !isa<TypeDecl>(vd))
1649
- return true ;
1650
-
1651
1648
return !knownDecls.insert (vd).second ;
1652
1649
}), decls.end ());
1653
1650
0 commit comments