Is the syntax inconsistency intentional?
Ziggit
Is the syntax inconsistency intentional?
const print = @import("std").debug.print; fn bar(n: i8) !usize { return if (n <= 0) error.A else 123; } pub fn main() !void { while (bar(0)) |_| { // The capture is optional. unreachable; } else |_| { print("while captures\n", .{}); } while (bar(0)) { // compiles unreachable; } else |_| { print("while no capture\n", .{}); } if (bar(0)) |_| { // The capture is required. unreachable; } else |_| { print("if capt...
0 comments
No comments yet.