chore: test case for empty logic expression

This commit is contained in:
Brett Broadhurst 2026-03-26 08:37:11 -06:00
parent 8fa228a9c2
commit 7afc6719d9
Failed to generate hash of commit
3 changed files with 16 additions and 4 deletions

View file

@ -757,9 +757,10 @@ fn expr(gi: *GenIr, scope: *Scope, optional_expr: ?*const Ast.Node) InnerError!I
}
fn exprStmt(gi: *GenIr, scope: *Scope, node: *const Ast.Node) InnerError!Ir.Inst.Ref {
// TODO: Maybe we should introduce a unary node type to avoid optional checks?
const expr_node = node.data.bin.lhs.?;
return expr(gi, scope, expr_node);
if (node.data.bin.lhs) |n| {
return expr(gi, scope, n);
}
return .none;
}
fn inlineLogicExpr(gi: *GenIr, scope: *Scope, node: *const Ast.Node) InnerError!Ir.Inst.Ref {