chore: test case for empty logic expression
This commit is contained in:
parent
8fa228a9c2
commit
7afc6719d9
3 changed files with 16 additions and 4 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue