Skip to content

Commit

Permalink
fix formatting fn with mut refenrence para
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyi98 committed Jun 20, 2024
1 parent 5e6ccf4 commit 7dbe27c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion vlib/v/ast/str.v
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,13 @@ fn (t &Table) stringify_fn_after_name(node &FnDecl, mut f strings.Builder, cur_m
}
f.write_string('}')
} else {
mut s := t.type_to_str(param.typ.clear_flag(.shared_f))
param_typ := if param.is_mut && !(param.typ.is_int_valptr()
|| param.typ.has_flag(.option)) {
param.typ.deref()
} else {
param.typ
}
mut s := t.type_to_str(param_typ.clear_flag(.shared_f))
if param.is_mut {
if s.starts_with('&') && ((!param_sym.is_number() && param_sym.kind != .bool)
|| node.language != .v) {
Expand Down

0 comments on commit 7dbe27c

Please sign in to comment.