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
Drop throws(any Error) and throws(Never) sugar after substitution
When substitution into a function type with `throws(E)` produces either
`throws(any Error)` or `throws(Never)`, adjust the resulting function
type to the equivalent `throws` or non-throwing.
trynotRethrowsLike2(body) // expected-error{{call can throw, but the error is not handled; a function declared 'rethrows' may only throw if its parameter does}}
180
180
trynotRethrowsLike3(body) // expected-error{{call can throw, but the error is not handled; a function declared 'rethrows' may only throw if its parameter does}}
181
181
}
182
+
183
+
// Substitution involving 'any Error' or 'Never' thrown error types should
184
+
// use untyped throws or be non-throwing.
185
+
enumG_E<T>{
186
+
case tuple((x:T, y:T))
187
+
}
188
+
189
+
func testArrMap(arr:[String]){
190
+
_ =mapArray(arr, body: G_E<Int>.tuple)
191
+
// expected-error@-1{{cannot convert value of type '((x: Int, y: Int)) -> G_E<Int>' to expected argument type '(String) -> G_E<Int>'}}
0 commit comments