| 1 | fn function_that_receives_an_array_of_generic_type[T](array []T) { |
| 2 | assert array.len == 0 |
| 3 | } |
| 4 | |
| 5 | fn function_that_returns_an_array_of_generic_type[T]() []T { |
| 6 | return [] |
| 7 | } |
| 8 | |
| 9 | fn func[T]() { |
| 10 | res := function_that_returns_an_array_of_generic_type[T]() |
| 11 | function_that_receives_an_array_of_generic_type(res) |
| 12 | assert res.len == 0 |
| 13 | function_that_receives_an_array_of_generic_type[T](res) |
| 14 | } |
| 15 | |
| 16 | fn test_main() { |
| 17 | func[string]() |
| 18 | func[int]() |
| 19 | func[f64]() |
| 20 | } |
| 21 |