| 1 | struct Test { |
| 2 | fn_test fn (x int, y [10]int, z []int) bool = fixed_array_fn |
| 3 | } |
| 4 | |
| 5 | fn fixed_array_fn(x int, y [10]int, z []int) bool { |
| 6 | return true |
| 7 | } |
| 8 | |
| 9 | fn test_anon_fn_with_fixed_array_arguments() { |
| 10 | assert true |
| 11 | } |
| 12 | |
| 13 | fn fn_arg(f fn ([]int) int) int { |
| 14 | return f([1, 2, 3]) |
| 15 | } |
| 16 | |
| 17 | fn test_anon_fn_with_array_arguments() { |
| 18 | anon := fn (i []int) int { |
| 19 | return 0 |
| 20 | } |
| 21 | |
| 22 | println(fn_arg(anon)) |
| 23 | assert fn_arg(anon) == 0 |
| 24 | } |
| 25 |