v2 / vlib / v / checker / tests / fixed_array_decompose_err.vv
12 lines · 11 sloc · 135 bytes · 828cd4fe790b242f8049bbcf13acc49954058eab
Raw
1fn sum(a ...int) int {
2 mut total := 0
3 for x in a {
4 total += x
5 }
6 return total
7}
8
9fn main() {
10 arr := [1, 2, 3, 4]!
11 sum(...arr)
12}
13