// RUN: %target-typecheck-verify-swift -disable-objc-attr-requires-foundation-module // RUN: not %target-swift-frontend -typecheck %s -debug-generic-signatures -disable-objc-attr-requires-foundation-module 2>&1 | %FileCheck %s // REQUIRES: objc_interop class C {} @objc protocol P1 {} protocol P2 {} protocol P3 : AnyObject {} protocol Q { associatedtype A } /// This is allowed, even though it's not fully sound. // CHECK-LABEL: .f1@ // CHECK-NEXT: Generic signature: func f1(_: T) where T.A : C, T.A == any (C & P1) {} /// These are not allowed. // CHECK-LABEL: .f2@ // CHECK-NEXT: Generic signature: func f2(_: T) where T.A : C, T.A == any P1 {} // expected-error@-1 {{no type for 'T.A' can satisfy both 'T.A : C' and 'T.A == any P1'}} // CHECK-LABEL: .f3@ // CHECK-NEXT: Generic signature: func f3(_: T) where T.A : C, T.A == any (C & P2) {} // expected-error@-1 {{no type for 'T.A' can satisfy both 'T.A : C' and 'T.A == any C & P2'}} // expected-error@-2 {{no type for 'T.A' can satisfy both 'T.A : _NativeClass' and 'T.A == any C & P2'}} // CHECK-LABEL: .f4@ // CHECK-NEXT: Generic signature: func f4(_: T) where T.A : C, T.A == any (C & P3) {} // expected-error@-1 {{no type for 'T.A' can satisfy both 'T.A : C' and 'T.A == any C & P3'}} // expected-error@-2 {{no type for 'T.A' can satisfy both 'T.A : _NativeClass' and 'T.A == any C & P3'}}