Navigation Menu

Skip to content

Commit

Permalink
cgen: correct comments for expr_with_tmp_var() (#17227)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyi98 committed Feb 5, 2023
1 parent fc65de9 commit 858ce4e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vlib/v/gen/c/cgen.v
Expand Up @@ -1831,8 +1831,8 @@ fn (mut g Gen) stmts_with_tmp_var(stmts []ast.Stmt, tmp_var string) bool {
return last_stmt_was_return
}

// expr_with_tmp_var is used in assign expr to `optinal` or `result` type.
// applicable to situations where the expr_typ does not have `optinal` and `result`,
// expr_with_tmp_var is used in assign expr to `option` or `result` type.
// applicable to situations where the expr_typ does not have `option` and `result`,
// e.g. field default: "foo ?int = 1", field assign: "foo = 1", field init: "foo: 1"
fn (mut g Gen) expr_with_tmp_var(expr ast.Expr, expr_typ ast.Type, ret_typ ast.Type, tmp_var string) {
if !ret_typ.has_flag(.option) && !ret_typ.has_flag(.result) {
Expand Down

0 comments on commit 858ce4e

Please sign in to comment.