fmt: fix formatting array decomposition (#7835)

pull/7844/head
Enzo 2021-01-03 16:19:43 +01:00 committed by GitHub
parent 9033099676
commit 22e54e6703
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -1140,6 +1140,7 @@ pub fn (mut f Fmt) expr(node ast.Expr) {
}
ast.ArrayDecompose {
f.expr(node.expr)
f.write('...')
}
}
}

View File

@ -0,0 +1,8 @@
fn varargs(a ...int) {
println(a)
}
fn main() {
a := [1, 2, 3]
varargs(a...)
}