@@ -314,13 +314,46 @@ class ConcreteContext2 {
314
314
}
315
315
316
316
class ConcreteContext3 {
317
+
317
318
func dynamicSelf1( ) -> Self { return self }
318
319
319
320
@objc func dynamicSelf1_( ) -> Self { return self }
320
321
// expected-error@-1{{method cannot be marked @objc because its result type cannot be represented in Objective-C}}
321
322
322
323
@objc func genericParams< T: NSObject > ( ) -> [ T ] { return [ ] }
323
324
// expected-error@-1{{method cannot be marked @objc because it has generic parameters}}
325
+
326
+ @objc func returnObjCProtocolMetatype( ) -> NSCoding . Protocol { return NSCoding . self }
327
+ // expected-error@-1{{method cannot be marked @objc because its result type cannot be represented in Objective-C}}
328
+
329
+ typealias AnotherNSCoding = NSCoding
330
+ typealias MetaNSCoding1 = NSCoding . Protocol
331
+ typealias MetaNSCoding2 = AnotherNSCoding . Protocol
332
+
333
+ @objc func returnObjCAliasProtocolMetatype1( ) -> AnotherNSCoding . Protocol { return NSCoding . self }
334
+ // expected-error@-1{{method cannot be marked @objc because its result type cannot be represented in Objective-C}}
335
+
336
+ @objc func returnObjCAliasProtocolMetatype2( ) -> MetaNSCoding1 { return NSCoding . self }
337
+ // expected-error@-1{{method cannot be marked @objc because its result type cannot be represented in Objective-C}}
338
+
339
+ @objc func returnObjCAliasProtocolMetatype3( ) -> MetaNSCoding2 { return NSCoding . self }
340
+ // expected-error@-1{{method cannot be marked @objc because its result type cannot be represented in Objective-C}}
341
+
342
+ typealias Composition = NSCopying & NSCoding
343
+
344
+ @objc func returnCompositionMetatype1( ) -> Composition . Protocol { return Composition . self }
345
+ // expected-error@-1{{method cannot be marked @objc because its result type cannot be represented in Objective-C}}
346
+
347
+ @objc func returnCompositionMetatype2( ) -> ( NSCopying & NSCoding ) . Protocol { return ( NSCopying & NSCoding) . self }
348
+ // expected-error@-1{{method cannot be marked @objc because its result type cannot be represented in Objective-C}}
349
+
350
+ typealias NSCodingExistential = NSCoding . Type
351
+
352
+ @objc func metatypeOfExistentialMetatypePram1( a: NSCodingExistential . Protocol ) { }
353
+ // expected-error@-1{{method cannot be marked @objc because the type of the parameter cannot be represented in Objective-C}}
354
+
355
+ @objc func metatypeOfExistentialMetatypePram2( a: NSCoding . Type . Protocol ) { }
356
+ // expected-error@-1{{method cannot be marked @objc because the type of the parameter cannot be represented in Objective-C}}
324
357
}
325
358
326
359
func genericContext1< T> ( _: T ) {
0 commit comments