mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge pull request #24520 from benlangmuir/cc-crash-keypath
[code-completion] Avoid invalid member substitution for keypath dynamic lookup
This commit is contained in:
@@ -2102,7 +2102,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;
|
||||
@@ -2111,7 +2112,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