Only report dynamic lookup methods once.

Previously we reported them once for their base name and once for their
full name, which is unnecessary. All clients were already de-duping, though.

Swift SVN r24051
This commit is contained in:
Jordan Rose
2014-12-20 01:59:07 +00:00
parent 832c45bd36
commit 7cd85363e8

View File

@@ -268,6 +268,11 @@ void SourceLookupCache::lookupClassMembers(AccessPathTy accessPath,
if (!accessPath.empty()) {
for (auto &member : ClassMembers) {
// Non-simple names are also stored under their simple name, so make
// sure to only report them once.
if (!member.first.isSimpleName())
continue;
for (ValueDecl *vd : member.second) {
Type ty = vd->getDeclContext()->getDeclaredTypeOfContext();
if (auto nominal = ty->getAnyNominal())
@@ -279,6 +284,11 @@ void SourceLookupCache::lookupClassMembers(AccessPathTy accessPath,
}
for (auto &member : ClassMembers) {
// Non-simple names are also stored under their simple name, so make sure to
// only report them once.
if (!member.first.isSimpleName())
continue;
for (ValueDecl *vd : member.second)
consumer.foundDecl(vd, DeclVisibilityKind::DynamicLookup);
}