Skip to content

Commit 6c33cfa

Browse files
authored
When loading Obj-C methods via a selector and the method is an accessor, import the property as well. (#17150)
1 parent 823ed14 commit 6c33cfa

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/ClangImporter/ClangImporter.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2769,6 +2769,11 @@ void ClangImporter::loadObjCMethods(
27692769
if (objcMethod->getClassInterface() != objcClass)
27702770
continue;
27712771

2772+
// If we found a property accessor, import the property.
2773+
if (objcMethod->isPropertyAccessor())
2774+
(void)Impl.importDecl(objcMethod->findPropertyDecl(true),
2775+
Impl.CurrentVersion);
2776+
27722777
if (auto method = dyn_cast_or_null<AbstractFunctionDecl>(
27732778
Impl.importDecl(objcMethod, Impl.CurrentVersion))) {
27742779
foundMethods.push_back(method);

0 commit comments

Comments
 (0)