mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
std.zig.AstGen: properly handle grouped_expression
This fixes an endless loop in the compiler.
This commit is contained in:
parent
ce355e0ba5
commit
d942f693c5
@ -2607,7 +2607,7 @@ fn blockExprStmts(gz: *GenZir, parent_scope: *Scope, statements: []const Ast.Nod
|
||||
.assign_mul_wrap => try assignOp(gz, scope, statement, .mulwrap),
|
||||
|
||||
.grouped_expression => {
|
||||
inner_node = tree.nodeData(statement).node_and_token[0];
|
||||
inner_node = tree.nodeData(inner_node).node_and_token[0];
|
||||
continue;
|
||||
},
|
||||
|
||||
|
||||
@ -0,0 +1,9 @@
|
||||
pub export fn entry() void {
|
||||
((1 + 1)); // makes sure that the doubled grouped_expression does not cause an endless loop in AstGen.
|
||||
}
|
||||
|
||||
// error
|
||||
//
|
||||
// :2:9: error: value of type 'comptime_int' ignored
|
||||
// :2:9: note: all non-void values must be used
|
||||
// :2:9: note: to discard the value, assign it to '_'
|
||||
Loading…
x
Reference in New Issue
Block a user