Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
felipensp committed Dec 22, 2023
1 parent 189e2e4 commit 028f9be
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion vlib/v/gen/c/cgen.v
Original file line number Diff line number Diff line change
Expand Up @@ -1819,7 +1819,8 @@ fn (mut g Gen) stmts_with_tmp_var(stmts []ast.Stmt, tmp_var string) bool {
g.expr(stmt.expr)
g.writeln(';')
} else {
ret_typ := if g.inside_struct_init {
// on assignemnt or struct field initialization
ret_typ := if g.inside_struct_init || g.inside_assign {
stmt.typ
} else {
g.fn_decl.return_type.clear_flag(.option)
Expand Down

0 comments on commit 028f9be

Please sign in to comment.