diff --git a/vlib/v/fmt/fmt.v b/vlib/v/fmt/fmt.v index 5dcdd48a65..f4c72901b9 100644 --- a/vlib/v/fmt/fmt.v +++ b/vlib/v/fmt/fmt.v @@ -1073,9 +1073,13 @@ pub fn (mut f Fmt) or_expr(or_block ast.OrExpr) { match or_block.kind { .absent {} .block { - f.writeln(' or {') - f.stmts(or_block.stmts) - f.write('}') + if or_block.stmts.len == 0 { + f.write(' or { }') + } else { + f.writeln(' or {') + f.stmts(or_block.stmts) + f.write('}') + } } .propagate { f.write('?')