vfmt: fix removing cmod. in []Enum return values

pull/5814/head
Delyan Angelov 2020-07-12 14:40:43 +03:00
parent 53023c1ca9
commit 53ee5eb043
1 changed files with 2 additions and 1 deletions

View File

@ -770,7 +770,8 @@ pub fn (table &Table) type_to_str(t Type) string {
if vals.len > 2 { if vals.len > 2 {
res = vals[vals.len - 2] + '.' + vals[vals.len - 1] res = vals[vals.len - 2] + '.' + vals[vals.len - 1]
} }
if res.starts_with(table.cmod_prefix) { if res.starts_with(table.cmod_prefix) ||
(sym.kind == .array && res.starts_with('[]' + table.cmod_prefix)) {
res = res.replace_once(table.cmod_prefix, '') res = res.replace_once(table.cmod_prefix, '')
} }
if sym.kind == .array && !res.starts_with('[]') { if sym.kind == .array && !res.starts_with('[]') {