zig/test/cases/x86_64-linux/comptime_var.1.zig
2022-10-20 20:11:00 +03:00

14 lines
260 B
Zig

pub fn main() void {
var a: u32 = 0;
comptime var b: u32 = 0;
switch (a) {
0 => {},
else => b = 3,
}
}
// error
//
// :6:19: error: store to comptime variable depends on runtime condition
// :4:13: note: runtime condition here