In new last version 0.10.1 it seems that for is not working with two arguments?
const std = @import("std");
const expect = std.testing.expect;
test "for basics" {
const items = [_]i32 {4,5,3,4,0};
var sum: i32 = 0;
for(items, 0.. ) |value,_| {
sum += value;
}
try expect(sum == 16);
}
ubuntu 22.04, snap zig version 0.10.1 ,
zig test 1.zig produces:
1.zig:7:12: error: expected ')', found ','
for(items, 0.. ) |value,_| {
^
Edited: To update, I tried snap, but using
snap install --classic --beta zig is a security risk because it can change the system and is not sandboxed. replies(1):