Skip to content

Commit d97640d

Browse files
committed
When loading Obj-C methods via a selector and the method is an accessor, import the property as well. (#17150)
1 parent 73ae90b commit d97640d

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)