Skip to content

Commit

Permalink
Update str.v
Browse files Browse the repository at this point in the history
  • Loading branch information
felipensp authored Nov 10, 2024
1 parent a9aa623 commit fa6954e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vlib/v/gen/c/str.v
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ fn (mut g Gen) gen_expr_to_string(expr ast.Expr, etype ast.Type) {
is_var_mut := expr.is_auto_deref_var()
str_fn_name := g.get_str_fn(typ)
g.write('${str_fn_name}(')
if sym.kind != .function {
if sym.kind != .function {
if str_method_expects_ptr && !is_ptr && !typ.has_flag(.option) {
g.write('&')
} else if (!str_method_expects_ptr && is_ptr && !is_shared) || is_var_mut {
Expand Down

0 comments on commit fa6954e

Please sign in to comment.