diff --git a/vlib/v/fmt/fmt.v b/vlib/v/fmt/fmt.v index 29a0117911..fc1c0205bf 100644 --- a/vlib/v/fmt/fmt.v +++ b/vlib/v/fmt/fmt.v @@ -1140,6 +1140,7 @@ pub fn (mut f Fmt) expr(node ast.Expr) { } ast.ArrayDecompose { f.expr(node.expr) + f.write('...') } } } diff --git a/vlib/v/fmt/tests/array_decomposition_keep.vv b/vlib/v/fmt/tests/array_decomposition_keep.vv new file mode 100644 index 0000000000..2822cd955a --- /dev/null +++ b/vlib/v/fmt/tests/array_decomposition_keep.vv @@ -0,0 +1,8 @@ +fn varargs(a ...int) { + println(a) +} + +fn main() { + a := [1, 2, 3] + varargs(a...) +}