zig/test/cases/comptime_var.5.zig

16 lines
200 B
Zig
Raw Normal View History

pub fn main() void {
var a: u32 = 0;
if (a == 0) {
comptime var b: u32 = 0;
b = 1;
}
}
comptime {
var x: i32 = 1;
x += 1;
if (x != 2) unreachable;
}
// run
//