1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

cgen: simplify codegen for optional consts (#13948)

This commit is contained in:
yuyi
2022-04-05 22:54:23 +08:00
committed by GitHub
parent 2ecfd1b351
commit 0cba579a7b

View File

@ -698,7 +698,7 @@ fn (mut g Gen) call_expr(node ast.CallExpr) {
} else if g.table.sym(node.return_type).kind == .multi_return {
g.write('\n $cur_line $tmp_opt /*U*/')
} else {
if !g.inside_const || !g.inside_const_optional {
if !g.inside_const_optional {
g.write('\n $cur_line (*($unwrapped_styp*)${tmp_opt}.data)')
} else {
g.write('\n $cur_line $tmp_opt')