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

cgen: remove extra ; from if_expr

This commit is contained in:
yuyi 2020-05-16 23:09:57 +08:00 committed by GitHub
parent f44a40eee0
commit 655d9bda94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -565,7 +565,7 @@ fn (mut g Gen) stmt(node ast.Stmt) {
}
ast.ExprStmt {
g.expr(it.expr)
if g.inside_ternary == 0 {
if g.inside_ternary == 0 && !(it.expr is ast.IfExpr) {
g.writeln(';')
}
}