mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Pass DynamicLookupInfo through VisibleDeclConsumers NFC
This commit adds a new type DynamicLookupInfo that provides information about how a dynamic member lookup found a particular Decl. This is needed to correctly handle KeyPath dynamic member lookups, but for now just plumb it through everywhere.
This commit is contained in:
@@ -2086,7 +2086,8 @@ void ModuleFile::lookupClassMembers(ModuleDecl::AccessPathTy accessPath,
|
||||
dc = dc->getParent();
|
||||
if (auto nominal = dc->getSelfNominalTypeDecl())
|
||||
if (nominal->getName() == accessPath.front().first)
|
||||
consumer.foundDecl(vd, DeclVisibilityKind::DynamicLookup);
|
||||
consumer.foundDecl(vd, DeclVisibilityKind::DynamicLookup,
|
||||
DynamicLookupInfo::AnyObject);
|
||||
}
|
||||
}
|
||||
return;
|
||||
@@ -2095,7 +2096,8 @@ void ModuleFile::lookupClassMembers(ModuleDecl::AccessPathTy accessPath,
|
||||
for (const auto &list : ClassMembersForDynamicLookup->data()) {
|
||||
for (auto item : list)
|
||||
consumer.foundDecl(cast<ValueDecl>(getDecl(item.second)),
|
||||
DeclVisibilityKind::DynamicLookup);
|
||||
DeclVisibilityKind::DynamicLookup,
|
||||
DynamicLookupInfo::AnyObject);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user