vxx2 / vlib / v / checker / tests / fn_call_arg_fn_mismatch_err.vv
15 lines · 12 sloc · 182 bytes · 1aad481c29b202b3752226af9ce005edc0d8f263
Raw
1// for issue 19325
2type Response = int | string
3
4fn foo() string {
5 return 'hello'
6}
7
8fn event(cb fn () Response) {
9 resp := cb()
10 assert resp is string
11}
12
13fn main() {
14 event(foo)
15}
16