From cd9bb51af266d6c13b93d1a5c13aa9b9fc1ab9ba Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Tue, 4 Aug 2020 16:08:47 +0300 Subject: [PATCH] vfmt: fix 6040 (part 2) --- vlib/v/fmt/fmt.v | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vlib/v/fmt/fmt.v b/vlib/v/fmt/fmt.v index 397e7efba3..4cf57aea51 100644 --- a/vlib/v/fmt/fmt.v +++ b/vlib/v/fmt/fmt.v @@ -537,10 +537,12 @@ pub fn (mut f Fmt) type_decl(node ast.TypeDecl) { fn_name := f.no_cur_mod(node.name) f.write('type $fn_name = fn (') for i, arg in fn_info.args { + if arg.is_mut { + f.write(arg.typ.share().str() + ' ') + } f.write(arg.name) mut s := f.no_cur_mod(f.table.type_to_str(arg.typ)) if arg.is_mut { - f.write(arg.typ.share().str() + ' ') if s.starts_with('&') { s = s[1..] }