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 05c6a25 commit 946f984
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vlib/v/gen/c/auto_str_methods.v
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,7 @@ 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_ {
if sym.kind == .interface_ && (sym.info as ast.Interface).defines_method('str') {
iface_obj := 'it.${final_field_name}${sufix}'
dot := if field_type.is_ptr() { '->' } else { '.' }
return '${fn_name.trim_string_right('_str')}_name_table[${iface_obj}${dot}_typ]._method_str(${iface_obj}${dot}_object)', true
Expand Down

0 comments on commit 946f984

Please sign in to comment.