1
1
// RUN: %target-typecheck-verify-swift -enable-experimental-variadic-generics
2
2
3
- func returnTuple1< @ _typeSequence T > ( ) -> ( T . . . ) { fatalError ( ) }
3
+ func returnTuple1< T ... > ( ) -> ( T . . . ) { fatalError ( ) }
4
4
5
- func returnTuple2< @ _typeSequence T > ( ) -> ( Int , T . . . ) { fatalError ( ) }
5
+ func returnTuple2< T ... > ( ) -> ( Int , T . . . ) { fatalError ( ) }
6
6
7
- func returnTupleLabel1< @ _typeSequence T > ( ) -> ( x: T . . . ) { fatalError ( ) }
7
+ func returnTupleLabel1< T ... > ( ) -> ( x: T . . . ) { fatalError ( ) }
8
8
9
- func returnTupleLabel2< @ _typeSequence T > ( ) -> ( Int , x: T . . . ) { fatalError ( ) }
9
+ func returnTupleLabel2< T ... > ( ) -> ( Int , x: T . . . ) { fatalError ( ) }
10
10
11
- func returnTupleLabel3< @ _typeSequence T > ( ) -> ( Int , T . . . , y: Float ) { fatalError ( ) }
11
+ func returnTupleLabel3< T ... > ( ) -> ( Int , T . . . , y: Float ) { fatalError ( ) }
12
12
// expected-note@-1 {{in call to function 'returnTupleLabel3()'}}
13
13
14
- func returnTupleLabel4< @ _typeSequence T > ( ) -> ( Int , x: T . . . , y: Float ) { fatalError ( ) }
14
+ func returnTupleLabel4< T ... > ( ) -> ( Int , x: T . . . , y: Float ) { fatalError ( ) }
15
15
16
- func returnTupleLabel5< @ _typeSequence T , @ _typeSequence U > ( ) -> ( Int , T . . . , y: U . . . ) { fatalError ( ) }
16
+ func returnTupleLabel5< T ... , U ... > ( ) -> ( Int , T . . . , y: U . . . ) { fatalError ( ) }
17
17
// expected-note@-1 {{in call to function 'returnTupleLabel5()'}}
18
18
19
- func returnTupleLabel6< @ _typeSequence T , @ _typeSequence U > ( ) -> ( Int , x: T . . . , y: U . . . ) { fatalError ( ) }
19
+ func returnTupleLabel6< T ... , U ... > ( ) -> ( Int , x: T . . . , y: U . . . ) { fatalError ( ) }
20
20
21
21
func concreteReturnTupleValid( ) {
22
22
let _: ( ) = returnTuple1 ( )
@@ -66,7 +66,7 @@ func concreteReturnTypeInvalid() {
66
66
let _: ( ) = returnTupleLabel5 ( ) // expected-error {{type of expression is ambiguous without more context}}
67
67
}
68
68
69
- func genericReturnTupleValid< @ _typeSequence T > ( _: T ... ) {
69
+ func genericReturnTupleValid< T ... > ( _: T ... ) {
70
70
let _: ( T . . . ) = returnTuple1 ( )
71
71
let _: ( Int , T . . . ) = returnTuple1 ( )
72
72
@@ -92,7 +92,7 @@ func genericReturnTupleValid<@_typeSequence T>(_: T...) {
92
92
let _: ( Int , x: String , T . . . , y: Float , T . . . ) = returnTupleLabel6 ( )
93
93
}
94
94
95
- func genericReturnTupleInvalid< @ _typeSequence T > ( _: T ... ) {
95
+ func genericReturnTupleInvalid< T ... > ( _: T ... ) {
96
96
let _: ( x: T . . . ) = returnTuple1 ( ) // expected-error {{type of expression is ambiguous without more context}}
97
97
let _: ( x: Int , T . . . ) = returnTuple1 ( ) // expected-error {{type of expression is ambiguous without more context}}
98
98
@@ -119,13 +119,13 @@ func genericReturnTupleInvalid<@_typeSequence T>(_: T...) {
119
119
let _: ( T . . . , y: Int ) = returnTupleLabel6 ( ) // expected-error {{cannot convert value of type '(Int, y: Int)' to specified type '(T..., y: Int)'}}
120
120
}
121
121
122
- func returnFunction1< @ _typeSequence T > ( ) -> ( T . . . ) -> ( ) { }
122
+ func returnFunction1< T ... > ( ) -> ( T . . . ) -> ( ) { }
123
123
124
- func returnFunction2< @ _typeSequence T > ( ) -> ( Int , T . . . ) -> ( ) { } // expected-note {{in call to function 'returnFunction2()'}}
124
+ func returnFunction2< T ... > ( ) -> ( Int , T . . . ) -> ( ) { } // expected-note {{in call to function 'returnFunction2()'}}
125
125
126
- func returnFunction3< @ _typeSequence T > ( ) -> ( T . . . , Float ) -> ( ) { } // expected-note {{in call to function 'returnFunction3()'}}
126
+ func returnFunction3< T ... > ( ) -> ( T . . . , Float ) -> ( ) { } // expected-note {{in call to function 'returnFunction3()'}}
127
127
128
- func returnFunction4< @ _typeSequence T > ( ) -> ( Int , T . . . , Float ) -> ( ) { } // expected-note 2{{in call to function 'returnFunction4()'}}
128
+ func returnFunction4< T ... > ( ) -> ( Int , T . . . , Float ) -> ( ) { } // expected-note 2{{in call to function 'returnFunction4()'}}
129
129
130
130
func concreteReturnFunctionValid( ) {
131
131
let _: ( ) -> ( ) = returnFunction1 ( )
0 commit comments