Skip to content

Commit 3b216a2

Browse files
authored
Merge pull request swiftlang#30323 from akyrtzi/usr-generation-objc-prop-external
2 parents 1a7e439 + 1082678 commit 3b216a2

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

test/Index/Inputs/cross_language.m

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ void test1() {
2121
[o someMethFromObjC];
2222
// CHECK: [[@LINE-1]]:6 | instance-method/ObjC | someMethFromObjC | [[someMethFromObjC_USR]] |
2323

24+
o.prop = 1;
25+
// CHECK: [[@LINE-1]]:5 | instance-property/Swift | prop | [[MyCls1_prop_USR]] |
26+
// CHECK: [[@LINE-2]]:5 | instance-method/acc-set/Swift | setProp: | [[MyCls1_prop_set_USR]] |
27+
int v = o.ext_prop;
28+
// CHECK: [[@LINE-1]]:13 | instance-property/Swift | ext_prop | [[MyCls1_ext_prop_USR]] |
29+
// CHECK: [[@LINE-2]]:13 | instance-method/acc-get/Swift | ext_prop | [[MyCls1_ext_prop_get_USR]] |
30+
2431
MyCls2 *o2 = [[MyCls2 alloc] initWithInt:0];
2532
// CHECK: [[@LINE-1]]:32 | instance-method/Swift | initWithInt: | [[MyCls2_initwithInt_USR]] |
2633

test/Index/cross_language.swift

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,13 @@ import Foundation
1919
// CHECK: [[@LINE-1]]:20 | class/Swift | MyCls1 | [[MyCls1_USR:.*]] | Def
2020
@objc public func someMeth() {}
2121
// CHECK: [[@LINE-1]]:21 | instance-method/Swift | someMeth() | [[MyCls1_someMeth_USR:.*]] | Def
22-
// CHECK: [[@LINE-4]]:38 | constructor/Swift | init() | [[MyCls1_init_USR:.*]] | Def,Impl,RelChild,RelOver | rel: 2
22+
23+
@objc public var prop = 0
24+
// CHECK: [[@LINE-1]]:20 | instance-property/Swift | prop | [[MyCls1_prop_USR:.*]] | Def
25+
// CHECK: [[@LINE-2]]:20 | instance-method/acc-get/Swift | getter:prop | [[MyCls1_prop_get_USR:.*]] | Def
26+
// CHECK: [[@LINE-3]]:20 | instance-method/acc-set/Swift | setter:prop | [[MyCls1_prop_set_USR:.*]] | Def
27+
28+
// CHECK: [[@LINE-10]]:38 | constructor/Swift | init() | [[MyCls1_init_USR:.*]] | Def,Impl,RelChild,RelOver | rel: 2
2329
// CHECK-NEXT: RelOver | constructor/Swift | init() | c:objc(cs)NSObject(im)init
2430
// CHECK-NEXT: RelChild | class/Swift | MyCls1 | [[MyCls1_USR]]
2531
}
@@ -40,6 +46,10 @@ public extension MyCls1 {
4046
// CHECK: [[@LINE-2]]:18 | class/Swift | MyCls1 | [[MyCls1_USR]] |
4147
@objc public func someExtMeth() {}
4248
// CHECK: [[@LINE-1]]:21 | instance-method/Swift | someExtMeth() | [[MyCls1_someExtMeth_USR:.*]] | Def
49+
50+
@objc public var ext_prop: Int { 0 }
51+
// CHECK: [[@LINE-1]]:20 | instance-property/Swift | ext_prop | [[MyCls1_ext_prop_USR:.*]] | Def
52+
// CHECK: [[@LINE-2]]:34 | instance-method/acc-get/Swift | getter:ext_prop | [[MyCls1_ext_prop_get_USR:.*]] | Def
4353
}
4454

4555
public extension SomeObjCClass {

0 commit comments

Comments
 (0)