From 029d583bb2f4b0af2ed99ce514a5db95008dbe91 Mon Sep 17 00:00:00 2001 From: yuyi Date: Thu, 7 Jul 2022 23:51:27 +0800 Subject: [PATCH] cgen: a minor fix in match_expr (#14983) --- vlib/v/gen/c/cgen.v | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vlib/v/gen/c/cgen.v b/vlib/v/gen/c/cgen.v index 2f895b40d5..c8d388bd5e 100644 --- a/vlib/v/gen/c/cgen.v +++ b/vlib/v/gen/c/cgen.v @@ -1751,7 +1751,11 @@ fn (mut g Gen) stmt(node ast.Stmt) { // } if g.inside_ternary == 0 && !g.inside_if_optional && !g.inside_match_optional && !node.is_expr && node.expr !is ast.IfExpr { - g.writeln(';') + if node.expr is ast.MatchExpr { + g.writeln('') + } else { + g.writeln(';') + } } } ast.FnDecl {