// RUN: %target-swift-frontend \ // RUN: -enable-experimental-feature SuppressedAssociatedTypes \ // RUN: -verify -typecheck %s -debug-generic-signatures \ // RUN: -debug-inverse-requirements 2>&1 | %FileCheck %s --implicit-check-not "error:" // REQUIRES: swift_feature_SuppressedAssociatedTypes // CHECK-LABEL: (file).genericFn@ // CHECK: Generic signature: func genericFn(_ t: T) {} // CHECK-LABEL: .withInverse1@ // CHECK: Generic signature: func withInverse1(_ t: borrowing T) {} // CHECK-LABEL: .withInverse2@ // CHECK: Generic signature: func withInverse2(_ t: borrowing T) {} // CHECK-LABEL: .withInverse3@ // CHECK: Generic signature: func withInverse3(_ t: borrowing T) {} // CHECK-LABEL: .where1@ // CHECK: Generic signature: func where1(_ t: borrowing T) where T: ~Copyable {} // CHECK-LABEL: .where2@ // CHECK: Generic signature: func where2(_ t: borrowing T) where T: NoCopyP, T: ~Copyable {} // CHECK-LABEL: .where3@ // CHECK: Generic signature: func where3(_ t: borrowing T) where T: Empty, T: ~Copyable {} // CHECK-LABEL: .where4@ // CHECK: Generic signature: func where4(_ t: borrowing T) where T: ~Escapable {} // CHECK-LABEL: .where5@ // CHECK: Generic signature: func where5(_ t: borrowing T) where T: Empty, T: ~Escapable {} // CHECK-LABEL: .where6@ // CHECK: Generic signature: func where6(_ t: borrowing T) where T: Empty, T: ~Copyable {} // CHECK-LABEL: .compose1@ // CHECK: Generic signature: func compose1(_ t: borrowing T) {} // CHECK-LABEL: .compose3@ // CHECK: Canonical generic signature: <τ_0_0 where τ_0_0 : NoCopyP> func compose3(_ t: inout some NoCopyP & ~Copyable) {} // CHECK-LABEL: .f1@ // CHECK: Generic signature: func f1(_ t: T) {} // CHECK-LABEL: .withSome@ // CHECK: Canonical generic signature: <τ_0_0 where τ_0_0 : Copyable, τ_0_0 : Escapable> func withSome(_ t: some Any) {} // CHECK-LABEL: .withSomeEmpty@ // CHECK: Canonical generic signature: <τ_0_0 where τ_0_0 : Copyable, τ_0_0 : Escapable, τ_0_0 : Empty> func withSomeEmpty(_ t: some Empty) {} // CHECK-LABEL: .withSomeProto@ // CHECK: Canonical generic signature: <τ_0_0 where τ_0_0 : Copyable, τ_0_0 : NoCopyP> func withSomeProto(_ t: some NoCopyP) {} // CHECK-LABEL: .withInverseSome@ // CHECK: Canonical generic signature: <τ_0_0 where τ_0_0 : Escapable> func withInverseSome(_ t: borrowing some ~Copyable) {} // CHECK-LABEL: .checkAnyObject@ // CHECK: Canonical generic signature: <τ_0_0 where τ_0_0 : AnyObject, τ_0_0 : Copyable, τ_0_0 : Escapable> func checkAnyObject(_ t: Result) where Result: AnyObject {} // CHECK-LABEL: .checkSoup@ // CHECK: Canonical generic signature: <τ_0_0 where τ_0_0 : Soup> class Soup {} func checkSoup(_ t: T) where T: Soup {} // CHECK-LABEL: .S1@ // CHECK: Generic signature: struct S1 {} // CHECK-LABEL: .S1_I@ // CHECK: Generic signature: struct S1_I {} // CHECK-LABEL: .C1@ // CHECK: Generic signature: class C1 {} // CHECK-LABEL: .C1_IC@ // CHECK: Generic signature: class C1_IC {} // CHECK-LABEL: .C1_CI@ // CHECK: Generic signature: class C1_CI where U: ~Copyable {} // CHECK-LABEL: .C1_II@ // CHECK: Generic signature: class C1_II {} // CHECK-LABEL: .Empty@ // CHECK: Requirement signature: protocol Empty: ~Copyable, ~Escapable {} // CHECK-LABEL: .NoEscapeP@ // CHECK: Requirement signature: protocol NoEscapeP: ~Escapable {} // CHECK-LABEL: .NoEscapeP2@ // CHECK: Requirement signature: protocol NoEscapeP2 where Self: NoEscapeP & ~Escapable {} // CHECK-LABEL: .ForgotTildeEscape@ // CHECK: Requirement signature: protocol ForgotTildeEscape where Self: NoEscapeP {} // CHECK-LABEL: .NoCopyP@ // CHECK: Requirement signature: protocol NoCopyP: ~Copyable {} // CHECK-LABEL: .NoCopyP2@ // CHECK: Requirement signature: protocol NoCopyP2 where Self: ~Copyable & NoCopyP {} // CHECK-LABEL: .CopyP@ // CHECK: Requirement signature: protocol CopyP {} // CHECK-LABEL: .CopyP2@ // CHECK: Requirement signature: protocol CopyP2: CopyP {} // CHECK-LABEL: .CopyInheritsNC@ // CHECK: Requirement signature: protocol CopyInheritsNC: NoCopyP {} // CHECK-LABEL: .P2@ // CHECK: protocol P2 { associatedtype A } // CHECK-LABEL: .P2_IC@ // CHECK: protocol P2_IC: ~Copyable { associatedtype A } // CHECK-LABEL: .P2_CI@ // CHECK: Requirement signature: protocol P2_CI { associatedtype A: ~Copyable } // CHECK-LABEL: .P2_II@ // CHECK: Requirement signature: protocol P2_II: ~Copyable { associatedtype A: ~Copyable } // CHECK-LABEL: .P3@ // CHECK: Requirement signature: protocol P3 where Self: (~Copyable & ~Escapable) { associatedtype B: ~Escapable } // CHECK-LABEL: .P4@ // CHECK: Requirement signature: protocol P4: ~Escapable { associatedtype B: ~Escapable associatedtype C: ~Copyable associatedtype D: ~Escapable, ~Copyable } // CHECK-LABEL: .Explicit@ // CHECK: Requirement signature: protocol Explicit: Copyable, Escapable { associatedtype Elm: Copyable, Escapable } // CHECK-LABEL: .Cond@ // CHECK: Generic signature: // CHECK-NEXT: Canonical generic signature: <τ_0_0 where τ_0_0 : Escapable> struct Cond: ~Copyable {} // CHECK-LABEL: ExtensionDecl line={{.*}} base=Cond // CHECK: // CHECK-NEXT: Canonical generic signature: <τ_0_0 where τ_0_0 : Copyable, τ_0_0 : Escapable> // CHECK-LABEL: ExtensionDecl line={{.*}} base=Cond // CHECK: (normal_conformance type="Cond" protocol="Copyable" // CHECK-NEXT: (requirement "T" conforms_to "Copyable")) extension Cond: Copyable where T: Copyable {} // CHECK-LABEL: .FullyGenericArg@ // CHECK: Generic signature: // CHECK-NEXT: Canonical generic signature: <τ_0_0> struct FullyGenericArg {} // CHECK-LABEL: StructDecl name=FullyGenericArg // CHECK-NEXT: (builtin_conformance type="FullyGenericArg" protocol="Copyable"{{.*}}) // CHECK-NEXT: (builtin_conformance type="FullyGenericArg" protocol="Escapable"{{.*}}) // CHECK-LABEL: ExtensionDecl line={{.*}} base=FullyGenericArg // CHECK: Generic signature: // CHECK-NEXT: Canonical generic signature: <τ_0_0> // CHECK-LABEL: ExtensionDecl line={{.*}} base=FullyGenericArg // CHECK-NEXT: (normal_conformance type="FullyGenericArg" protocol="Empty"{{.*}}) extension FullyGenericArg: Empty where T: ~Copyable, T: ~Escapable {}