Skip to content

Commit

Permalink
minor optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyi98 committed Jul 15, 2024
1 parent d27c37a commit 49401be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vlib/v/checker/check_types.v
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ fn (mut c Checker) check_expected_call_arg(got ast.Type, expected_ ast.Type, lan
}

// `fn foo(mut p &Expr); mut expr := Expr{}; foo(mut expr)`
if expected.nr_muls() > 1 && arg.is_mut && !got.is_ptr() {
if arg.is_mut && expected.nr_muls() > 1 && !got.is_ptr() {
got_typ_str, expected_typ_str := c.get_string_names_of(got, expected)
return error('cannot use `${got_typ_str}` as `${expected_typ_str}`')
}
Expand Down

0 comments on commit 49401be

Please sign in to comment.