1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

vfmt: fix 6040 (part 2)

This commit is contained in:
Delyan Angelov 2020-08-04 16:08:47 +03:00
parent f9d241ae27
commit cd9bb51af2

View File

@ -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..]
}