@@ -48,7 +48,7 @@ func testRead1(r: Lens<Rectangle>, a: Lens<[Int]>) {
48
48
// CHECK: [[TL_LINE:[0-9]+]]:7 | param/Swift | r
49
49
50
50
// => implicit dynamicMember subscript (topLeft)
51
- // CHECK: [[TL_LINE]]:9 | instance-property/subscript/Swift | subscript(dynamicMember:) | [[SUB_USR]] | Ref,Read,RelCont | rel: 1
51
+ // CHECK: [[TL_LINE]]:9 | instance-property/subscript/Swift | subscript(dynamicMember:) | [[SUB_USR]] | Ref,Read,Impl, RelCont | rel: 1
52
52
// CHECK: [[TL_LINE]]:9 | instance-method/acc-get/Swift | getter:subscript(dynamicMember:) | [[SUB_GET_USR]] | Ref,Call,Impl,RelRec,RelCall,RelCont | rel: 2
53
53
54
54
// => property topLeft
@@ -59,15 +59,15 @@ func testRead1(r: Lens<Rectangle>, a: Lens<[Int]>) {
59
59
// CHECK: [[BR_LINE:[0-9]+]]:7 | param/Swift | r
60
60
61
61
// => implicit dynamicMember subscript (bottomRight)
62
- // CHECK: [[BR_LINE]]:9 | instance-property/subscript/Swift | subscript(dynamicMember:) | [[SUB_USR]] | Ref,Read,RelCont | rel: 1
62
+ // CHECK: [[BR_LINE]]:9 | instance-property/subscript/Swift | subscript(dynamicMember:) | [[SUB_USR]] | Ref,Read,Impl, RelCont | rel: 1
63
63
// CHECK: [[BR_LINE]]:9 | instance-method/acc-get/Swift | getter:subscript(dynamicMember:) | [[SUB_GET_USR]] | Ref,Call,Impl,RelRec,RelCall,RelCont | rel: 2
64
64
65
65
// => property bottomRight
66
66
// CHECK: [[BR_LINE]]:9 | instance-property/Swift | bottomRight | [[BR_USR]] | Ref,Read,RelCont | rel: 1
67
67
// CHECK: [[BR_LINE]]:9 | instance-method/acc-get/Swift | getter:bottomRight | [[BR_GET_USR]] | Ref,Call,Impl,RelCall,RelCont | rel: 1
68
68
69
69
// => implicit dynamicMember subscript (y)
70
- // CHECK: [[BR_LINE]]:21 | instance-property/subscript/Swift | subscript(dynamicMember:) | [[SUB_USR]] | Ref,Read,RelCont | rel: 1
70
+ // CHECK: [[BR_LINE]]:21 | instance-property/subscript/Swift | subscript(dynamicMember:) | [[SUB_USR]] | Ref,Read,Impl, RelCont | rel: 1
71
71
// CHECK: [[BR_LINE]]:21 | instance-method/acc-get/Swift | getter:subscript(dynamicMember:) | [[SUB_GET_USR]] | Ref,Call,Impl,RelRec,RelCall,RelCont | rel: 2
72
72
73
73
// => property y
@@ -78,7 +78,7 @@ func testRead1(r: Lens<Rectangle>, a: Lens<[Int]>) {
78
78
// CHECK: [[A_LINE:[0-9]+]]:7 | param/Swift | a
79
79
80
80
// => implicit dynamicMember subscript
81
- // CHECK: [[A_LINE]]:8 | instance-property/subscript/Swift | subscript(dynamicMember:) | [[SUB_USR]] | Ref,Read,RelCont | rel: 1
81
+ // CHECK: [[A_LINE]]:8 | instance-property/subscript/Swift | subscript(dynamicMember:) | [[SUB_USR]] | Ref,Read,Impl, RelCont | rel: 1
82
82
// CHECK: [[A_LINE]]:8 | instance-method/acc-get/Swift | getter:subscript(dynamicMember:) | [[SUB_GET_USR]] | Ref,Call,Impl,RelRec,RelCall,RelCont | rel: 2
83
83
84
84
// => subscript [Int]
@@ -92,7 +92,7 @@ func testWrite1(r: inout Lens<Rectangle>, p: Lens<Point>, a: inout Lens<[Int]>)
92
92
// CHECK: [[WTL_LINE:[0-9]+]]:3 | param/Swift | r
93
93
94
94
// => implicit dynamicMember subscript (topLeft)
95
- // CHECK: [[WTL_LINE]]:5 | instance-property/subscript/Swift | subscript(dynamicMember:) | [[SUB_USR]] | Ref,Writ,RelCont | rel: 1
95
+ // CHECK: [[WTL_LINE]]:5 | instance-property/subscript/Swift | subscript(dynamicMember:) | [[SUB_USR]] | Ref,Writ,Impl, RelCont | rel: 1
96
96
// CHECK: [[WTL_LINE]]:5 | instance-method/acc-set/Swift | setter:subscript(dynamicMember:) | [[SUB_SET_USR]] | Ref,Call,Impl,RelCall,RelCont | rel: 1
97
97
98
98
// => property topLeft
@@ -103,7 +103,7 @@ func testWrite1(r: inout Lens<Rectangle>, p: Lens<Point>, a: inout Lens<[Int]>)
103
103
// CHECK: [[WBR_LINE:[0-9]+]]:3 | param/Swift | r
104
104
105
105
// => implicit dynamicMember subscript (bottomRight)
106
- // CHECK: [[WBR_LINE:[0-9]+]]:5 | instance-property/subscript/Swift | subscript(dynamicMember:) | [[SUB_USR]] | Ref,Read,Writ,RelCont | rel: 1
106
+ // CHECK: [[WBR_LINE:[0-9]+]]:5 | instance-property/subscript/Swift | subscript(dynamicMember:) | [[SUB_USR]] | Ref,Read,Writ,Impl, RelCont | rel: 1
107
107
// CHECK: [[WBR_LINE:[0-9]+]]:5 | instance-method/acc-get/Swift | getter:subscript(dynamicMember:) | [[SUB_GET_USR]] | Ref,Call,Impl,RelCall,RelCont | rel: 1
108
108
// CHECK: [[WBR_LINE:[0-9]+]]:5 | instance-method/acc-set/Swift | setter:subscript(dynamicMember:) | [[SUB_SET_USR]] | Ref,Call,Impl,RelCall,RelCont | rel: 1
109
109
@@ -113,7 +113,7 @@ func testWrite1(r: inout Lens<Rectangle>, p: Lens<Point>, a: inout Lens<[Int]>)
113
113
// CHECK: [[WBR_LINE:[0-9]+]]:5 | instance-method/acc-set/Swift | setter:bottomRight | [[BR_SET_USR]] | Ref,Call,Impl,RelCall,RelCont | rel: 1
114
114
115
115
// => implicit dynamicMember subscript (y)
116
- // CHECK: [[WBR_LINE:[0-9]+]]:17 | instance-property/subscript/Swift | subscript(dynamicMember:) | [[SUB_USR]] | Ref,Writ,RelCont | rel: 1
116
+ // CHECK: [[WBR_LINE:[0-9]+]]:17 | instance-property/subscript/Swift | subscript(dynamicMember:) | [[SUB_USR]] | Ref,Writ,Impl, RelCont | rel: 1
117
117
// CHECK: [[WBR_LINE:[0-9]+]]:17 | instance-method/acc-set/Swift | setter:subscript(dynamicMember:) | [[SUB_SET_USR]] | Ref,Call,Impl,RelCall,RelCont | rel: 1
118
118
119
119
// => property y
@@ -123,3 +123,17 @@ func testWrite1(r: inout Lens<Rectangle>, p: Lens<Point>, a: inout Lens<[Int]>)
123
123
// FIXME: crashes typechecker rdar://problem/49533404
124
124
// a[0] = Lens(1)
125
125
}
126
+
127
+ func testExplicit( r: Lens < Rectangle > , a: Lens < [ Int ] > ) {
128
+ _ = r [ dynamicMember: \. topLeft]
129
+ // CHECK: [[ETL_LINE:[0-9]+]]:7 | param/Swift | r
130
+ // Not implicit.
131
+ // CHECK: [[ETL_LINE]]:8 | instance-property/subscript/Swift | subscript(dynamicMember:) | [[SUB_USR]] | Ref,Read,RelCont | rel: 1
132
+ // CHECK: [[ETL_LINE]]:26 | instance-property/Swift | topLeft | [[TL_USR]] | Ref,Read,RelCont | rel: 1
133
+
134
+ _ = a [ dynamicMember: \. [ 0 ] ]
135
+ // CHECK: [[EA_LINE:[0-9]+]]:7 | param/Swift | a
136
+ // Not implicit.
137
+ // CHECK: [[EA_LINE]]:8 | instance-property/subscript/Swift | subscript(dynamicMember:) | [[SUB_USR]] | Ref,Read,RelCont | rel: 1
138
+ // CHECK: [[EA_LINE]]:26 | instance-property/subscript/Swift | subscript(_:) | s:SayxSicip | Ref,Read,RelCont | rel: 1
139
+ }
0 commit comments