commit 8afadee45a7a7ea8e456b5917db4fbfdd140b555 (tree)
parent 5311916928ac627b86549099ac76f82f151fb662
Author: mlugg <mlugg@mlugg.co.uk>
Date: Sun, 25 Jun 2023 02:24:03 +0100
AstGen: use usize as result type of for loop range operands
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/AstGen.zig b/src/AstGen.zig
@@ -6480,11 +6480,11 @@ fn forExpr(
return astgen.failTok(ident_tok, "cannot capture reference to range", .{});
}
const start_node = node_data[input].lhs;
- const start_val = try expr(parent_gz, scope, .{ .rl = .none }, start_node);
+ const start_val = try expr(parent_gz, scope, .{ .rl = .{ .coerced_ty = .usize_type } }, start_node);
const end_node = node_data[input].rhs;
const end_val = if (end_node != 0)
- try expr(parent_gz, scope, .{ .rl = .none }, node_data[input].rhs)
+ try expr(parent_gz, scope, .{ .rl = .{ .coerced_ty = .usize_type } }, node_data[input].rhs)
else
.none;