Skip to content

Commit 7feb622

Browse files
committed
[test] check some Ty signatures
1 parent 695b07d commit 7feb622

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/Generics/inverse_signatures.swift

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,22 @@ func genericFn<T>(_ t: T) {}
1010
// CHECK: Generic signature: <T>
1111
func withInverse<T: ~Copyable>(_ t: borrowing T) {}
1212

13+
// CHECK-LABEL: .withSome@
14+
// CHECK: Canonical generic signature: <τ_0_0 where τ_0_0 : Copyable>
15+
func withSome(_ t: some Any) {}
16+
17+
// CHECK-LABEL: .withSomeEquatable@
18+
// CHECK: Canonical generic signature: <τ_0_0 where τ_0_0 : Copyable, τ_0_0 : Equatable>
19+
func withSomeEquatable(_ t: some Equatable) {}
20+
21+
// CHECK-LABEL: .withSomeProto@
22+
// CHECK: Canonical generic signature: <τ_0_0 where τ_0_0 : Copyable, τ_0_0 : NoCopyP>
23+
func withSomeProto(_ t: some NoCopyP) {}
24+
25+
// CHECK-LABEL: .withInverseSome@
26+
// CHECK: Canonical generic signature: <τ_0_0>
27+
func withInverseSome(_ t: some ~Copyable) {}
28+
1329
// CHECK-LABEL: .S1@
1430
// CHECK: Generic signature: <T where T : Copyable>
1531
struct S1<T> {}
@@ -34,6 +50,10 @@ class C1_CI<T, U: ~Copyable> {}
3450
// CHECK: Generic signature: <T, U>
3551
class C1_II<T: ~Copyable, U: ~Copyable> {}
3652

53+
// CHECK-LABEL: .NoCopyP@
54+
// CHECK: Requirement signature: <Self>
55+
protocol NoCopyP: ~Copyable {}
56+
3757
// CHECK-LABEL: .P1@
3858
// CHECK: Requirement signature: <Self where Self : Copyable>
3959
protocol P1 {}

0 commit comments

Comments
 (0)