Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
felipensp committed Nov 14, 2023
1 parent 78a8eb2 commit f1aee55
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions vlib/v/gen/c/if.v
Original file line number Diff line number Diff line change
Expand Up @@ -378,13 +378,10 @@ fn (mut g Gen) if_expr(node ast.IfExpr) {
no_needs_par = true
}
}
inside_casting_to_str_old := g.inside_casting_to_str
if !g.inside_casting_to_str && branch.cond is ast.Ident
&& g.table.is_interface_var(branch.cond.obj) {
inside_casting_to_str_old := g.inside_casting_to_str
g.inside_casting_to_str = true
defer {
g.inside_casting_to_str = inside_casting_to_str_old
}
}
if no_needs_par {
g.write('if ')
Expand All @@ -397,6 +394,7 @@ fn (mut g Gen) if_expr(node ast.IfExpr) {
} else {
g.writeln(') {')
}
g.inside_casting_to_str = inside_casting_to_str_old
}
}
if needs_tmp_var {
Expand Down

0 comments on commit f1aee55

Please sign in to comment.