vfmt: handle fixed size arrays

pull/4945/head
Alexander Medvednikov 2020-05-18 16:52:09 +02:00
parent 9a237c3e82
commit 90270d8791
2 changed files with 5 additions and 0 deletions

View File

@ -1042,6 +1042,10 @@ fn (mut f Fmt) array_init(it ast.ArrayInit) {
f.indent-- f.indent--
} }
f.write(']') f.write(']')
// `[100]byte`
if it.is_fixed {
f.write(f.type_to_str(it.elem_type))
}
} }
fn (mut f Fmt) struct_init(it ast.StructInit) { fn (mut f Fmt) struct_init(it ast.StructInit) {

View File

@ -11,4 +11,5 @@ fn main() {
] ]
x := []int{len: 10, cap: 100, init: 1} x := []int{len: 10, cap: 100, init: 1}
_ := expected_flags _ := expected_flags
buf := [100]byte
} }