From 77bcdcad67d609b01d0fbd93a31dd941f18b9228 Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Wed, 22 Nov 2023 21:05:57 -0300 Subject: [PATCH] fix --- vlib/v/gen/c/auto_str_methods.v | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vlib/v/gen/c/auto_str_methods.v b/vlib/v/gen/c/auto_str_methods.v index ffe0b4dc494c14..26f6afc19c9aac 100644 --- a/vlib/v/gen/c/auto_str_methods.v +++ b/vlib/v/gen/c/auto_str_methods.v @@ -1068,6 +1068,12 @@ fn struct_auto_str_func(sym &ast.TypeSymbol, lang ast.Language, _field_type ast. } else if _field_type.has_flag(.option) || should_use_indent_func(sym.kind) { obj := '${deref}it.${final_field_name}${sufix}' if has_custom_str { + if sym.kind == .interface_ { + mut s := '${fn_name.trim_string_right('_str')}_name_table[${obj}' + dot := if field_type.is_ptr() { '->' } else { '.' } + s += '${dot}_typ]._method_str(${obj}${dot}_object)' + return s, true + } return '${fn_name}(${obj})', true } return 'indent_${fn_name}(${obj}, indent_count + 1)', true