zig/test/cases/x86_64-linux/comptime_var.0.zig

13 lines
262 B
Zig
Raw Normal View History

pub fn main() void {
var a: u32 = 0;
comptime var b: u32 = 0;
if (a == 0) b = 3;
}
// error
// output_mode=Exe
// target=x86_64-linux
//
// :4:19: error: store to comptime variable depends on runtime condition
// :4:11: note: runtime condition here