diff --git a/vlib/v/fmt/fmt.v b/vlib/v/fmt/fmt.v index 86639bf54f..76b8d1edd4 100644 --- a/vlib/v/fmt/fmt.v +++ b/vlib/v/fmt/fmt.v @@ -1042,6 +1042,10 @@ fn (mut f Fmt) array_init(it ast.ArrayInit) { f.indent-- } 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) { diff --git a/vlib/v/fmt/tests/array_newlines_keep.vv b/vlib/v/fmt/tests/array_newlines_keep.vv index 7ae0d9d648..822e0cbad1 100644 --- a/vlib/v/fmt/tests/array_newlines_keep.vv +++ b/vlib/v/fmt/tests/array_newlines_keep.vv @@ -11,4 +11,5 @@ fn main() { ] x := []int{len: 10, cap: 100, init: 1} _ := expected_flags + buf := [100]byte }