Skip to content

Commit 79a05e5

Browse files
authored
When loading Obj-C methods via a selector and the method is an accessor, import the property as well. (#17150) (#17193)
1 parent db10c68 commit 79a05e5

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
@@ -2772,6 +2772,11 @@ void ClangImporter::loadObjCMethods(
27722772
if (objcMethod->getClassInterface() != objcClass)
27732773
continue;
27742774

2775+
// If we found a property accessor, import the property.
2776+
if (objcMethod->isPropertyAccessor())
2777+
(void)Impl.importDecl(objcMethod->findPropertyDecl(true),
2778+
Impl.CurrentVersion);
2779+
27752780
if (auto method = dyn_cast_or_null<AbstractFunctionDecl>(
27762781
Impl.importDecl(objcMethod, Impl.CurrentVersion))) {
27772782
foundMethods.push_back(method);

0 commit comments

Comments
 (0)