zig
zig copied to clipboard
Adding `comptime` to a variable previously declared `var` when it's value is constant segfaults the compiler.
Zig Version
0.12.0-dev.64+b835fd90c
Steps to Reproduce and Observed Behavior
var flag: bool = false;
if (comptime flag) {}
Expected Behavior
This worked in the previous tagged release of 0.10.1, but not sure if it still should. The fix (and more obvious declaration) of comptime var flag works. The compiler probably shouldn't segfault, but instead return a compileError.