Zig Version
0.16.0-dev.1574+5d96a58f1
Steps to Reproduce and Observed Output
run zig build for the following code (the error is in "switch" statement -> "swtch" instead of "switch"):
const std = @import("std");
const Union1 = union(enum) {
f1: usize,
f2: []const u8
};
fn test_func(value: Union1) void {
swtch (value) {
.f1 => |v|std.debug.print("{d}", .{v}),
else => {}
}
}
pub fn main() !void {
test_func(.{.f1 = 0});
}
error message:
test.zig:10:13: error: expected ',' after initializer
.f1 => |v|std.debug.print("{d}", .{v}),
Expected Output
I expect something like "invalid expression" or "unknown keyword" in test.zig:9:4