cgen: remove extra `;` from if_expr

pull/4921/head
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
1 changed files with 1 additions and 1 deletions

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(';')
}
}