File tree Expand file tree Collapse file tree 4 files changed +23
-16
lines changed Expand file tree Collapse file tree 4 files changed +23
-16
lines changed Original file line number Diff line number Diff line change
1
+ // REQUIRES: rdar104716322
2
+
1
3
// RUN: %target-typecheck-verify-swift -enable-experimental-feature VariadicGenerics
2
4
3
5
// REQUIRES: asserts
@@ -9,17 +11,16 @@ func f<T...>(_: repeat each T) {
9
11
_ = G< > . self
10
12
_ = G< Int> . self
11
13
_ = G < Int , String > . self
12
- _ = G< repeat T> . self
13
- _ = G < Int , repeat Array < T > > . self
14
+ _ = G< repeat each T> . self
15
+ _ = G < Int , repeat Array < each T > > . self
14
16
}
15
17
16
18
// Forming PackExpansionTypeReprs in simplifyTypeExpr()
17
19
func g< T... > ( _: repeat each T ) {
18
- _ = ( repeat T) . self
19
- _ = ( Int, repeat T) . self
20
- _ = ( ( repeat T) - > ( ) ) . self
21
- _ = ( ( Int, repeat Array < T > ) - > ( ) ) . self
20
+ _ = ( repeat each T) . self
21
+ _ = ( Int, repeat each T) . self
22
+ _ = ( ( repeat each T) - > ( ) ) . self
23
+ _ = ( ( Int, repeat Array < each T > ) - > ( ) ) . self
22
24
23
- _ = ( repeat Int) . self // expected-error {{variadic expansion 'Int' must contain at least one variadic generic parameter}}
25
+ _ = ( repeat each Int) . self // expected-error {{variadic expansion 'Int' must contain at least one variadic generic parameter}}
24
26
}
25
-
Original file line number Diff line number Diff line change
1
+ // REQUIRES: rdar104716322
2
+
1
3
// RUN: %target-swift-frontend -emit-ir -primary-file %s -enable-experimental-feature VariadicGenerics | %FileCheck %s
2
4
3
5
// Because of -enable-experimental-feature VariadicGenerics
@@ -18,7 +20,7 @@ struct G<T...> {
18
20
}
19
21
20
22
func makeTuple1( ) -> ( repeat each T ) . Type {
21
- return ( repeat T) . self
23
+ return ( repeat each T) . self
22
24
}
23
25
24
26
func makeTuple2( ) -> ( repeat Array < each T > ) . Type {
Original file line number Diff line number Diff line change
1
+ // REQUIRES: rdar104716322
2
+
1
3
// RUN: %target-run-simple-swift(-enable-experimental-feature VariadicGenerics) | %FileCheck %s
2
4
3
5
// REQUIRES: executable_test
7
9
8
10
struct G < T... > {
9
11
func makeTuple( ) {
10
- print( ( repeat ( Array < T > ) ) . self)
12
+ print( ( repeat ( Array < each T > ) ) . self)
11
13
}
12
14
}
13
15
Original file line number Diff line number Diff line change
1
+ // REQUIRES: rdar104716322
2
+
1
3
// RUN: %target-swift-emit-silgen %s -enable-experimental-feature VariadicGenerics | %FileCheck %s
2
4
3
5
// Experimental features require an asserts compiler
@@ -36,10 +38,10 @@ func variadicMetatypes<T...>(_: repeat each T) {
36
38
_ = VariadicType< > . self
37
39
_ = VariadicType< Int> . self
38
40
_ = VariadicType < Int , String > . self
39
- _ = VariadicType< repeat T> . self
40
- _ = VariadicType < Int , repeat Array < T > > . self
41
- _ = ( repeat T) . self
42
- _ = ( Int, repeat Array < T > ) . self
43
- _ = ( ( repeat T) - > ( ) ) . self
44
- _ = ( ( Int, repeat Array < T > ) - > ( ) ) . self
41
+ _ = VariadicType< repeat each T> . self
42
+ _ = VariadicType < Int , repeat Array < each T > > . self
43
+ _ = ( repeat each T) . self
44
+ _ = ( Int, repeat Array < each T > ) . self
45
+ _ = ( ( repeat each T) - > ( ) ) . self
46
+ _ = ( ( Int, repeat Array < each T > ) - > ( ) ) . self
45
47
}
You can’t perform that action at this time.
0 commit comments