Skip to content

Commit 160cc12

Browse files
authored
Merge pull request #77313 from nkcsgexi/protocol-handled-objc-message
2 parents dc25477 + 8d0815e commit 160cc12

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/FrontendTool/LoadedModuleTrace.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,8 @@ class ObjcMethodReferenceCollector: public SourceEntityWalker {
849849
return "interface_type";
850850
if (isa<clang::ObjCCategoryDecl>(clangD))
851851
return "category_type";
852+
if (isa<clang::ObjCProtocolDecl>(clangD))
853+
return "protocol_type";
852854
return "type";
853855
}
854856
public:

test/IDE/objc_send_collector.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,18 @@
77

88
import Foo
99

10-
public func testProperties(_ x: FooClassBase) {
10+
public func testProperties(_ x: FooClassBase, _ y: FooProtocolBase) {
1111
_ = x.fooBaseInstanceFunc0()
1212
x.fooBaseInstanceFunc1(1.2)
1313
_ = FooClassBase.fooBaseClassFunc0()
14+
y.fooProtoFunc()
1415
}
1516

1617
// CHECK-DAG: "instance_method": "fooBaseInstanceFunc0"
1718
// CHECK-DAG: "instance_method": "fooBaseInstanceFunc1:"
1819
// CHECK-DAG: "class_method": "fooBaseClassFunc0"
1920
// CHECK-DAG: "interface_type": "FooClassBase"
21+
// CHECK-DAG: "protocol_type": "FooProtocolBase"
2022
// CHECK-DAG: "declared_at": "SOURCE_DIR/test/IDE/Inputs/mock-sdk/Foo.framework/Headers/Foo.h
2123
// CHECK-DAG: "referenced_at_file_id": 1
2224
// CHECK-DAG: "file_id": 1,

0 commit comments

Comments
 (0)