mirror of
https://github.com/ziglang/zig.git
synced 2024-11-27 23:52:31 +00:00
15 lines
272 B
Zig
15 lines
272 B
Zig
pub fn main() void {
|
|
var a: u32 = 0;
|
|
_ = &a;
|
|
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
|