mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
11 lines
176 B
V
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'
|
|
}
|