Prevent vfmt from appending the module name to FnTypeDecl inside the same module (#5080)
parent
4988d340b1
commit
cecb7d29c7
|
@ -382,7 +382,7 @@ pub fn (mut f Fmt) type_decl(node ast.TypeDecl) {
|
||||||
f.write('type $fn_name = fn (')
|
f.write('type $fn_name = fn (')
|
||||||
for i, arg in fn_info.args {
|
for i, arg in fn_info.args {
|
||||||
f.write(arg.name)
|
f.write(arg.name)
|
||||||
mut s := f.table.type_to_str(arg.typ)
|
mut s := f.table.type_to_str(arg.typ).replace(f.cur_mod + '.', '')
|
||||||
if arg.is_mut {
|
if arg.is_mut {
|
||||||
f.write('mut ')
|
f.write('mut ')
|
||||||
if s.starts_with('&') {
|
if s.starts_with('&') {
|
||||||
|
@ -405,7 +405,7 @@ pub fn (mut f Fmt) type_decl(node ast.TypeDecl) {
|
||||||
}
|
}
|
||||||
f.write(')')
|
f.write(')')
|
||||||
if fn_info.return_type.idx() != table.void_type_idx {
|
if fn_info.return_type.idx() != table.void_type_idx {
|
||||||
ret_str := f.table.type_to_str(fn_info.return_type)
|
ret_str := f.table.type_to_str(fn_info.return_type).replace(f.cur_mod + '.', '')
|
||||||
f.write(' ' + ret_str)
|
f.write(' ' + ret_str)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue