Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
felipensp committed Nov 23, 2023
1 parent cd145b2 commit 77bcdca
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions vlib/v/gen/c/auto_str_methods.v
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 77bcdca

Please sign in to comment.