v2 / vlib / v / tests / generics / generic_fn_with_anon_fn_test.v
11 lines · 10 sloc · 151 bytes · 6488041a749df9762348d019c4223908c476f2e2
Raw
1fn foo[T]() string {
2 x := fn () string {
3 return 'ok'
4 }
5 return x()
6}
7
8fn test_generic_fn_with_anon_fn() {
9 ret := foo[int]()
10 assert ret == 'ok'
11}
12