Skip to content

Commit e49fccf

Browse files
authored
Merge pull request #66195 from NuriAmari/release/5.9
[Swift-ObjC-Interop] Speculative cyclic lookup fix
2 parents cff9d10 + 1fe0aa6 commit e49fccf

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/ClangImporter/ImportDecl.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4533,7 +4533,13 @@ namespace {
45334533
SmallVector<Decl *, 4> matchingTopLevelDecls;
45344534

45354535
// Get decls with a matching @objc attribute
4536-
module->lookupTopLevelDeclsByObjCName(matchingTopLevelDecls, name);
4536+
module->getTopLevelDeclsWhereAttributesMatch(
4537+
matchingTopLevelDecls, [&name](const DeclAttributes attrs) -> bool {
4538+
if (auto objcAttr = attrs.getAttribute<ObjCAttr>())
4539+
if (auto objcName = objcAttr->getName())
4540+
return objcName->getSimpleName() == name;
4541+
return false;
4542+
});
45374543

45384544
// Filter by decl kind
45394545
for (auto result : matchingTopLevelDecls) {

0 commit comments

Comments
 (0)