From 53ee5eb0431ad769df3882305e0eea7856607b4f Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sun, 12 Jul 2020 14:40:43 +0300 Subject: [PATCH] vfmt: fix removing cmod. in []Enum return values --- vlib/v/table/atypes.v | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vlib/v/table/atypes.v b/vlib/v/table/atypes.v index 0c69775d1f..0ef3861c42 100644 --- a/vlib/v/table/atypes.v +++ b/vlib/v/table/atypes.v @@ -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('[]') {