v/vlib/v/tests/generics_with_fixed_array_t...

11 lines
176 B
V

fn show_element<T>(arr T) string {
return '${arr[1]}'
}
fn test_generic_with_fixed_array_type() {
a := [1, 2, 3]!
ret := show_element(a)
println(ret)
assert ret == '2'
}