mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
fmt: fix formatting array decomposition (#7835)
This commit is contained in:
parent
9033099676
commit
22e54e6703
@ -1140,6 +1140,7 @@ pub fn (mut f Fmt) expr(node ast.Expr) {
|
|||||||
}
|
}
|
||||||
ast.ArrayDecompose {
|
ast.ArrayDecompose {
|
||||||
f.expr(node.expr)
|
f.expr(node.expr)
|
||||||
|
f.write('...')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
8
vlib/v/fmt/tests/array_decomposition_keep.vv
Normal file
8
vlib/v/fmt/tests/array_decomposition_keep.vv
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fn varargs(a ...int) {
|
||||||
|
println(a)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
a := [1, 2, 3]
|
||||||
|
varargs(a...)
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user