@@ -383,7 +383,8 @@ ValueDecl *UnqualifiedLookupFactory::lookupBaseDecl(const DeclContext *baseDC) c
383383 return nullptr ;
384384
385385 auto selfDecl = ASTScope::lookupSingleLocalDecl (DC->getParentSourceFile (),
386- DeclName (Ctx.Id_self ), Loc);
386+ DeclNameRef::createSelf (Ctx),
387+ Loc);
387388 if (!selfDecl) {
388389 return nullptr ;
389390 }
@@ -910,14 +911,14 @@ namespace {
910911
911912class ASTScopeDeclConsumerForLocalLookup
912913 : public AbstractASTScopeDeclConsumer {
913- DeclName name;
914+ DeclNameRef name;
914915 bool stopAfterInnermostBraceStmt;
915916 ABIRole roleFilter;
916917 SmallVectorImpl<ValueDecl *> &results;
917918
918919public:
919920 ASTScopeDeclConsumerForLocalLookup (
920- DeclName name, bool stopAfterInnermostBraceStmt,
921+ DeclNameRef name, bool stopAfterInnermostBraceStmt,
921922 ABIRole roleFilter, SmallVectorImpl<ValueDecl *> &results)
922923 : name(name), stopAfterInnermostBraceStmt(stopAfterInnermostBraceStmt),
923924 roleFilter (roleFilter), results(results) {}
@@ -928,6 +929,8 @@ class ASTScopeDeclConsumerForLocalLookup
928929
929930 bool consume (ArrayRef<ValueDecl *> values,
930931 NullablePtr<DeclContext> baseDC) override {
932+ if (name.hasModuleSelector ()) return false ;
933+
931934 for (auto *value: values) {
932935 bool foundMatch = false ;
933936 if (auto *varDecl = dyn_cast<VarDecl>(value)) {
@@ -941,7 +944,7 @@ class ASTScopeDeclConsumerForLocalLookup
941944 });
942945 }
943946
944- if (!foundMatch && value->getName ().matchesRef (name)
947+ if (!foundMatch && value->getName ().matchesRef (name. getFullName () )
945948 && hasCorrectABIRole (value))
946949 results.push_back (value);
947950 }
@@ -968,7 +971,7 @@ class ASTScopeDeclConsumerForLocalLookup
968971
969972// / Lookup that only finds local declarations and does not trigger
970973// / interface type computation.
971- void ASTScope::lookupLocalDecls (SourceFile *sf, DeclName name, SourceLoc loc,
974+ void ASTScope::lookupLocalDecls (SourceFile *sf, DeclNameRef name, SourceLoc loc,
972975 bool stopAfterInnermostBraceStmt,
973976 ABIRole roleFilter,
974977 SmallVectorImpl<ValueDecl *> &results) {
@@ -977,7 +980,7 @@ void ASTScope::lookupLocalDecls(SourceFile *sf, DeclName name, SourceLoc loc,
977980 ASTScope::unqualifiedLookup (sf, loc, consumer);
978981}
979982
980- ValueDecl *ASTScope::lookupSingleLocalDecl (SourceFile *sf, DeclName name,
983+ ValueDecl *ASTScope::lookupSingleLocalDecl (SourceFile *sf, DeclNameRef name,
981984 SourceLoc loc) {
982985 SmallVector<ValueDecl *, 1 > result;
983986 ASTScope::lookupLocalDecls (sf, name, loc,
0 commit comments