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

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

This commit is contained in:
Delyan Angelov 2020-07-12 14:40:43 +03:00
parent 53023c1ca9
commit 53ee5eb043

View File

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