You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
func returnFunction2<@_typeSequence T>()->(Int,T...)->(){} // expected-note {{in call to function 'returnFunction2()'}}
125
+
126
+
func returnFunction3<@_typeSequence T>()->(T...,Float)->(){} // expected-note {{in call to function 'returnFunction3()'}}
127
+
128
+
func returnFunction4<@_typeSequence T>()->(Int,T...,Float)->(){} // expected-note 2{{in call to function 'returnFunction4()'}}
129
+
130
+
func concreteReturnFunctionValid(){
131
+
let _:()->()=returnFunction1()
132
+
let _:(Int)->()=returnFunction1()
133
+
let _:(String,Double)->()=returnFunction1()
134
+
135
+
let _:(Int)->()=returnFunction2()
136
+
let _:(Int,Int)->()=returnFunction2()
137
+
let _:(Int,String,Double)->()=returnFunction2()
138
+
139
+
let _:(Float)->()=returnFunction3()
140
+
let _:(Int,Float)->()=returnFunction3()
141
+
let _:(String,Double,Float)->()=returnFunction3()
142
+
143
+
let _:(Int,Float)->()=returnFunction4()
144
+
let _:(Int,Int,Float)->()=returnFunction4()
145
+
let _:(Int,String,Double,Float)->()=returnFunction4()
146
+
}
147
+
148
+
func concreteReturnFunctionInvalid(){
149
+
let _:()->()=returnFunction2() // expected-error {{cannot convert value of type '(Int, T...) -> ()' to specified type '() -> ()'}}
150
+
// expected-error@-1 {{generic parameter 'T' could not be inferred}}
151
+
let _:(String)->()=returnFunction2() // expected-error {{cannot convert value of type '(Int) -> ()' to specified type '(String) -> ()'}}
152
+
let _:(String,Int)->()=returnFunction2() // expected-error {{cannot convert value of type '(Int, Int) -> ()' to specified type '(String, Int) -> ()'}}
153
+
154
+
let _:()->()=returnFunction3() // expected-error {{cannot convert value of type '(T..., Float) -> ()' to specified type '() -> ()'}}
155
+
// expected-error@-1 {{generic parameter 'T' could not be inferred}}
156
+
let _:(Float,Int)->()=returnFunction3() // expected-error {{cannot convert value of type '(Float, Float) -> ()' to specified type '(Float, Int) -> ()'}}
157
+
let _:(Float,Double,String)->()=returnFunction3() // expected-error {{cannot convert value of type '(Float, Double, Float) -> ()' to specified type '(Float, Double, String) -> ()'}}
158
+
159
+
let _:()->()=returnFunction4() // expected-error {{cannot convert value of type '(Int, T..., Float) -> ()' to specified type '() -> ()'}}
160
+
// expected-error@-1 {{generic parameter 'T' could not be inferred}}
161
+
let _:(Int)->()=returnFunction4() // expected-error {{cannot convert value of type '(Int, T..., Float) -> ()' to specified type '(Int) -> ()'}}
162
+
// expected-error@-1 {{generic parameter 'T' could not be inferred}}
163
+
let _:(Float,Int)->()=returnFunction4() // expected-error {{cannot convert value of type '(Int, Float) -> ()' to specified type '(Float, Int) -> ()'}}
0 commit comments