mirror of
https://github.com/ziglang/zig.git
synced 2024-11-27 23:52:31 +00:00
378d3e4403
Changed container and initializer syntax * <container> { ... } -> <container> . { ... } * <exrp> { ... } -> <expr> . { ...}
29 lines
564 B
Zig
29 lines
564 B
Zig
const std = @import("std");
|
|
const assert = std.debug.assert;
|
|
|
|
test "ignore lval with underscore" {
|
|
_ = false;
|
|
}
|
|
|
|
test "ignore lval with underscore (for loop)" {
|
|
for ([]void.{}) |_, i| {
|
|
for ([]void.{}) |_, j| {
|
|
break;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
test "ignore lval with underscore (while loop)" {
|
|
while (optionalReturnError()) |_| {
|
|
while (optionalReturnError()) |_| {
|
|
break;
|
|
} else |_| {}
|
|
break;
|
|
} else |_| {}
|
|
}
|
|
|
|
fn optionalReturnError() !?u32 {
|
|
return error.optionalReturnError;
|
|
}
|