vfmt: fix table.type_to_str(), keep map[string]mod.Type in fn args
parent
acf0b84523
commit
3a369f513c
|
@ -700,8 +700,10 @@ pub fn (table &Table) type_to_str(t Type) string {
|
|||
if sym.kind == .array || 'array_' in res {
|
||||
res = res.replace('array_', '[]')
|
||||
}
|
||||
mut map_start := ''
|
||||
if sym.kind == .map || 'map_string_' in res {
|
||||
res = res.replace('map_string_', 'map[string]')
|
||||
map_start = 'map[string]'
|
||||
}
|
||||
// mod.submod.submod2.Type => submod2.Type
|
||||
if res.contains('.') {
|
||||
|
@ -712,6 +714,9 @@ pub fn (table &Table) type_to_str(t Type) string {
|
|||
if sym.kind == .array && !res.starts_with('[]') {
|
||||
res = '[]' + res
|
||||
}
|
||||
if sym.kind == .map && !res.starts_with('map') {
|
||||
res = map_start + res
|
||||
}
|
||||
}
|
||||
nr_muls := t.nr_muls()
|
||||
if nr_muls > 0 {
|
||||
|
|
Loading…
Reference in New Issue