This commit is contained in:
Felipe Pena 2025-08-09 15:25:40 -03:00
parent a2f65c6977
commit fb9e75c5ed
2 changed files with 9 additions and 1 deletions

View file

@ -7106,7 +7106,7 @@ fn (mut g Gen) gen_or_block_stmts(cvar_name string, cast_typ string, stmts []ast
g.writeln(' }, (${option_name}*)&${cvar_name}, sizeof(${cast_typ}));')
g.indent--
return
} else {
} else if return_type.clear_option_and_result() != ast.void_type {
g.write('*(${cast_typ}*) ${cvar_name}${tmp_op}data = ')
}
}

View file

@ -0,0 +1,8 @@
fn f() ? {
println('hello')
return none
}
fn test_main() {
f() or { dump(err) }
}