Skip to content

Commit f432270

Browse files
committed
Add serialization test for round-tripping PackElementType
1 parent 15bd01b commit f432270

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
public typealias A<each T, U, V> = (repeat (each T, U, V))
2+
3+
public struct G<each T> {
4+
public typealias B<each U, V> = (repeat A<repeat each T, each U, V>)
5+
6+
public struct H<each U> {
7+
public typealias C<each V> = (repeat B<repeat each U, each V>)
8+
}
9+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: %target-swift-frontend %S/Inputs/nested_pack_expansion_other.swift -emit-module -emit-module-path %t/nested_pack_expansion_other.swiftmodule -disable-availability-checking
3+
// RUN: %target-typecheck-verify-swift -I %t -disable-availability-checking
4+
5+
import nested_pack_expansion_other
6+
7+
func sameType<T>(_: T.Type, _: T.Type) {}
8+
9+
struct X1 {}
10+
struct Y1 {}
11+
struct Z1 {}
12+
13+
struct X2 {}
14+
struct Y2 {}
15+
struct Z2 {}
16+
17+
struct X3 {}
18+
struct Y3 {}
19+
struct Z3 {}
20+
21+
typealias Expanded = ((((X1, X2, X3),
22+
(Y1, X2, X3),
23+
(Z1, X2, X3)),
24+
((X1, Y2, X3),
25+
(Y1, Y2, X3),
26+
(Z1, Y2, X3)),
27+
((X1, Z2, X3),
28+
(Y1, Z2, X3),
29+
(Z1, Z2, X3))),
30+
(((X1, X2, Y3),
31+
(Y1, X2, Y3),
32+
(Z1, X2, Y3)),
33+
((X1, Y2, Y3),
34+
(Y1, Y2, Y3),
35+
(Z1, Y2, Y3)),
36+
((X1, Z2, Y3),
37+
(Y1, Z2, Y3),
38+
(Z1, Z2, Y3))),
39+
(((X1, X2, Z3),
40+
(Y1, X2, Z3),
41+
(Z1, X2, Z3)),
42+
((X1, Y2, Z3),
43+
(Y1, Y2, Z3),
44+
(Z1, Y2, Z3)),
45+
((X1, Z2, Z3),
46+
(Y1, Z2, Z3),
47+
(Z1, Z2, Z3))))
48+
49+
sameType(G<X1, Y1, Z1>.H<X2, Y2, Z2>.C<X3, Y3, Z3>.self, Expanded.self)
50+

0 commit comments

Comments
 (0)