mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
fix
This commit is contained in:
parent
a2f65c6977
commit
fb9e75c5ed
2 changed files with 9 additions and 1 deletions
|
@ -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 = ')
|
||||
}
|
||||
}
|
||||
|
|
8
vlib/v/tests/options/option_or_expr_dump_test.v
Normal file
8
vlib/v/tests/options/option_or_expr_dump_test.v
Normal file
|
@ -0,0 +1,8 @@
|
|||
fn f() ? {
|
||||
println('hello')
|
||||
return none
|
||||
}
|
||||
|
||||
fn test_main() {
|
||||
f() or { dump(err) }
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue