cgen: simplify codegen for optional consts (#13948)

pull/13953/head
yuyi 2022-04-05 22:54:23 +08:00 committed by GitHub
parent 2ecfd1b351
commit 0cba579a7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

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')