authorgravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2023-06-25 02:24:03+01:00
committergravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2023-06-25 13:28:31+01:00
log8afadee45a7a7ea8e456b5917db4fbfdd140b555
tree9fcf79ff2c24701e3979053980fa62fee0b0c521
parent5311916928ac627b86549099ac76f82f151fb662
signaturelock-open Commit is signed but in an unrecognized format.

AstGen: use usize as result type of for loop range operands


1 files changed, 2 insertions(+), 2 deletions(-)

src/AstGen.zig+2-2
...@@ -6480,11 +6480,11 @@ fn forExpr(...@@ -6480,11 +6480,11 @@ fn forExpr(
6480 return astgen.failTok(ident_tok, "cannot capture reference to range", .{});6480 return astgen.failTok(ident_tok, "cannot capture reference to range", .{});
6481 }6481 }
6482 const start_node = node_data[input].lhs;6482 const start_node = node_data[input].lhs;
6483 const start_val = try expr(parent_gz, scope, .{ .rl = .none }, start_node);6483 const start_val = try expr(parent_gz, scope, .{ .rl = .{ .coerced_ty = .usize_type } }, start_node);
64846484
6485 const end_node = node_data[input].rhs;6485 const end_node = node_data[input].rhs;
6486 const end_val = if (end_node != 0)6486 const end_val = if (end_node != 0)
6487 try expr(parent_gz, scope, .{ .rl = .none }, node_data[input].rhs)6487 try expr(parent_gz, scope, .{ .rl = .{ .coerced_ty = .usize_type } }, node_data[input].rhs)
6488 else6488 else
6489 .none;6489 .none;
64906490