// RUN: %target-typecheck-verify-swift -import-objc-header %S/Inputs/conditional_conformances_objc.h // REQUIRES: objc_interop protocol Foo {} extension ObjC: Foo where ObjectType == ObjC2 {} // expected-error@-1{{type 'ObjC' cannot conditionally conform to protocol 'Foo' because the type uses the Objective-C generics model}} protocol Bar {} extension ObjC: Bar where ObjectType: Bar {} // expected-error@-1{{type 'ObjC' cannot conditionally conform to protocol 'Bar' because the type uses the Objective-C generics model}} extension ObjC { struct Struct { enum Enum {} } class Class {} } extension ObjC.Struct: Foo where ObjectType == ObjC2 {} // expected-error@-1{{type 'ObjC.Struct' cannot conditionally conform to protocol 'Foo' because the type uses the Objective-C generics model}} extension ObjC.Struct: Bar where ObjectType: Bar {} // expected-error@-1{{type 'ObjC.Struct' cannot conditionally conform to protocol 'Bar' because the type uses the Objective-C generics model}} extension ObjC.Struct.Enum: Foo where ObjectType == ObjC2 {} // expected-error@-1{{type 'ObjC.Struct.Enum' cannot conditionally conform to protocol 'Foo' because the type uses the Objective-C generics model}} extension ObjC.Struct.Enum: Bar where ObjectType: Bar {} // expected-error@-1{{type 'ObjC.Struct.Enum' cannot conditionally conform to protocol 'Bar' because the type uses the Objective-C generics model}} extension ObjC.Class: Foo where T == ObjC2 {} // expected-error@-1{{type 'ObjC.Class' cannot conditionally conform to protocol 'Foo' because the type uses the Objective-C generics model}} extension ObjC.Class: Bar where T: Bar {} // expected-error@-1{{type 'ObjC.Class' cannot conditionally conform to protocol 'Bar' because the type uses the Objective-C generics model}} @objc protocol AtObjCProtocol {} class X {} extension X: ObjCProtocol where T: Foo {} // expected-error@-1{{type 'X' cannot conditionally conform to '@objc' protocol 'ObjCProtocol' because Objective-C does not support conditional conformances}} extension X: AtObjCProtocol where T: Foo {} // expected-error@-1{{type 'X' cannot conditionally conform to '@objc' protocol 'AtObjCProtocol' because Objective-C does not support conditional conformances}}