@@ -123,7 +123,7 @@ extension GenericClass {
123
123
_ = T . self // expected-note{{used here}}
124
124
}
125
125
// expected-error@+1{{extension of a generic Objective-C class cannot access the class's generic parameters}}
126
- @ objc func usesGenericParamE( _ x: Int ) {
126
+ @ objc func usesGenericParamE( _ x: Int ) {
127
127
_ = x as? T // expected-note{{used here}}
128
128
}
129
129
// expected-error@+1{{extension of a generic Objective-C class cannot access the class's generic parameters}}
@@ -249,18 +249,22 @@ extension AnimalContainer {
249
249
}
250
250
251
251
252
+ // expected-note@+2{{add '@objc' to allow uses of 'self' within the function body}}{{3-3=@objc }}
252
253
// expected-error@+1{{extension of a generic Objective-C class cannot access the class's generic parameters}}
253
254
func usesGenericParamA( _ x: T ) {
254
255
_ = T ( noise: x) // expected-note{{used here}}
255
256
}
257
+ // expected-note@+2{{add '@objc' to allow uses of 'self' within the function body}}{{3-3=@objc }}
256
258
// expected-error@+1{{extension of a generic Objective-C class cannot access the class's generic parameters}}
257
259
func usesGenericParamB( ) {
258
260
_ = T . create ( ) // expected-note{{used here}}
259
261
}
262
+ // expected-note@+2{{add '@objc' to allow uses of 'self' within the function body}}{{3-3=@objc }}
260
263
// expected-error@+1{{extension of a generic Objective-C class cannot access the class's generic parameters}}
261
264
func usesGenericParamC( ) {
262
265
_ = T . apexPredator // expected-note{{used here}}
263
266
}
267
+ // expected-note@+2{{add '@objc' to allow uses of 'self' within the function body}}{{3-3=@objc }}
264
268
// expected-error@+1{{extension of a generic Objective-C class cannot access the class's generic parameters}}
265
269
func usesGenericParamD( _ x: T ) {
266
270
T . apexPredator = x // expected-note{{used here}}
@@ -269,6 +273,7 @@ extension AnimalContainer {
269
273
// rdar://problem/27796375 -- allocating init entry points for ObjC
270
274
// initializers are generated as true Swift generics, so reify type
271
275
// parameters.
276
+ // expected-note@+2{{add '@objc' to allow uses of 'self' within the function body}}{{3-3=@objc }}
272
277
// expected-error@+1{{extension of a generic Objective-C class cannot access the class's generic parameters}}
273
278
func usesGenericParamE( _ x: T ) {
274
279
_ = GenericClass ( thing: x) // expected-note{{used here}}
0 commit comments