|
| 1 | +// RUN: %target-swift-frontend \ |
| 2 | +// RUN: -enable-experimental-feature NoncopyableGenerics \ |
| 3 | +// RUN: -enable-experimental-feature NonescapableTypes \ |
| 4 | +// RUN: -verify -typecheck %s -debug-generic-signatures \ |
| 5 | +// RUN: -debug-inverse-requirements 2>&1 | %FileCheck %s --implicit-check-not "error:" |
| 6 | + |
| 7 | +// CHECK-LABEL: .Outer@ |
| 8 | +// CHECK: Generic signature: <A where A : Escapable> |
| 9 | + |
| 10 | +// CHECK-LABEL: .Outer.innerFn@ |
| 11 | +// CHECK: Generic signature: <A, B where A : Escapable, B : Escapable> |
| 12 | + |
| 13 | +// CHECK-LABEL: .Outer.InnerStruct@ |
| 14 | +// CHECK: Generic signature: <A, C where A : Escapable, C : Escapable> |
| 15 | + |
| 16 | +// CHECK-LABEL: .Outer.InnerStruct.g@ |
| 17 | +// CHECK: Generic signature: <A, C, D where A : Escapable, C : Escapable, D : Escapable> |
| 18 | + |
| 19 | +// CHECK-LABEL: .Outer.InnerStruct.init()@ |
| 20 | +// CHECK: Generic signature: <A, C where A : Escapable, C : Escapable> |
| 21 | + |
| 22 | +// CHECK: (normal_conformance type="Outer<A>.InnerStruct<C>" protocol="Escapable") |
| 23 | + |
| 24 | +// CHECK-LABEL: .Outer.InnerVariation1@ |
| 25 | +// CHECK: Generic signature: <A, D where A : Escapable, D : Escapable> |
| 26 | + |
| 27 | +// CHECK-LABEL: .Outer.InnerVariation2@ |
| 28 | +// CHECK: Generic signature: <A, D where A : Escapable, D : Copyable> |
| 29 | + |
| 30 | +// CHECK-LABEL: ExtensionDecl {{.*}} base=Outer.InnerStruct |
| 31 | +// CHECK: Generic signature: <A, C where A : Copyable, A : Escapable, C : Copyable, C : Escapable> |
| 32 | + |
| 33 | +// CHECK-LABEL: .InnerStruct extension.hello@ |
| 34 | +// CHECK: Generic signature: <A, C, T where A : Copyable, A : Escapable, C : Copyable, C : Escapable, T : Copyable> |
| 35 | + |
| 36 | +// CHECK-LABEL: .Freestanding@ |
| 37 | +// CHECK: Generic signature: <T> |
| 38 | + |
| 39 | +// CHECK-LABEL: ExtensionDecl {{.*}} base=Outer |
| 40 | +// CHECK: Generic signature: <A where A : Copyable, A : Escapable> |
| 41 | + |
| 42 | +// CHECK-LABEL: ExtensionDecl {{.*}} base=Outer.InnerVariation1 |
| 43 | +// CHECK: Generic signature: <A, D where A : Escapable, D : Copyable, D : Escapable> |
| 44 | + |
| 45 | +// CHECK-LABEL: ExtensionDecl {{.*}} base=Outer.InnerVariation2 |
| 46 | +// CHECK: Generic signature: <A, D where A : Escapable, D : Copyable> |
| 47 | + |
| 48 | +// CHECK-LABEL: ExtensionDecl line=0 base=Outer<A>.InnerStruct<C> |
| 49 | +// CHECK-NEXT: (normal_conformance type="Outer<A>.InnerStruct<C>" protocol="Copyable" |
| 50 | +// CHECK-NEXT: (requirement "A" conforms_to "Copyable") |
| 51 | +// CHECK-NEXT: (requirement "C" conforms_to "Copyable")) |
| 52 | + |
| 53 | +// CHECK-LABEL: ExtensionDecl line=0 base=Outer<A>.InnerVariation1<D> |
| 54 | +// CHECK-NEXT: (normal_conformance type="Outer<A>.InnerVariation1<D>" protocol="Copyable" |
| 55 | +// CHECK-NEXT: (requirement "A" conforms_to "Copyable") |
| 56 | +// CHECK-NEXT: (requirement "D" conforms_to "Copyable")) |
| 57 | + |
| 58 | +// CHECK-LABEL: ExtensionDecl line=0 base=Outer<A>.InnerVariation2<D> |
| 59 | +// CHECK-NEXT: (normal_conformance type="Outer<A>.InnerVariation2<D>" protocol="Escapable" |
| 60 | +// CHECK-NEXT: (requirement "D" conforms_to "Escapable")) |
| 61 | + |
| 62 | +// CHECK-LABEL: ExtensionDecl line=0 base=Outer<A> |
| 63 | +// CHECK-NEXT: (normal_conformance type="Outer<A>" protocol="Copyable" |
| 64 | +// CHECK-NEXT: (requirement "A" conforms_to "Copyable")) |
| 65 | + |
| 66 | +// CHECK-LABEL: ExtensionDecl line=0 base=Freestanding<T> |
| 67 | +// CHECK-NEXT: (normal_conformance type="Freestanding<T>" protocol="Copyable" |
| 68 | +// CHECK-NEXT: (requirement "T" conforms_to "Copyable")) |
| 69 | + |
| 70 | +// CHECK-LABEL: ExtensionDecl line=0 base=Freestanding<T> |
| 71 | +// CHECK-NEXT: (normal_conformance type="Freestanding<T>" protocol="Escapable" |
| 72 | +// CHECK-NEXT: (requirement "T" conforms_to "Escapable")) |
| 73 | + |
| 74 | +public struct Outer<A: ~Copyable> { |
| 75 | + public func innerFn<B: ~Copyable>(_ b: borrowing B) {} |
| 76 | + public struct InnerStruct<C: ~Copyable> { |
| 77 | + public func g<D>(_ d: borrowing D) where D: ~Copyable {} |
| 78 | + } |
| 79 | + public struct InnerVariation1<D: ~Copyable>: ~Escapable {} |
| 80 | + public struct InnerVariation2<D: ~Escapable>: ~Copyable {} |
| 81 | +} |
| 82 | + |
| 83 | +extension Outer.InnerStruct { |
| 84 | + public func hello<T: ~Escapable>(_ t: T) {} |
| 85 | +} |
| 86 | + |
| 87 | +public struct Freestanding<T: ~Copyable> where T: ~Escapable {} |
| 88 | + |
| 89 | +extension Outer {} |
| 90 | +extension Outer.InnerVariation1 where A: ~Copyable {} |
| 91 | +extension Outer.InnerVariation2 where D: ~Escapable, A: ~Copyable {} |
0 commit comments