Skip to content

Commit 9a73766

Browse files
authored
comptime: dont emit empty blocks (#26171)
1 parent f7cfec2 commit 9a73766

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

‎vlib/v/comptime/comptime.v‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,8 @@ pub fn (mut c Comptime) expr_stmt(mut node ast.Expr) StmtOrExpr {
141141
if !node.is_expr && !node.has_else && node.branches.len == 1 {
142142
if node.branches[0].stmts.len == 0 {
143143
// empty ifdef; result of target OS != conditional => skip
144-
return ast.Stmt(ast.Block{
145-
pos: node.pos
146-
scope: ast.empty_scope
144+
return ast.Stmt(ast.EmptyStmt{
145+
pos: node.pos
147146
})
148147
}
149148
if !c.pref.output_cross_c {

0 commit comments

Comments
 (0)