v/vlib/v/tests/generic_fn_with_anon_fn_test.v

12 lines
151 B
V

fn foo<T>() string {
x := fn () string {
return 'ok'
}
return x()
}
fn test_generic_fn_with_anon_fn() {
ret := foo<int>()
assert ret == 'ok'
}