boolean-if
on optional invalidly allowed at comptime
#21742
Labels
bug
Observed behavior contradicts documented or intended behavior
miscompilation
The compiler reports success but produces semantically incorrect code.
Zig Version
0.14.0-dev.1924+bdd3bc056
Steps to Reproduce and Observed Behavior
Expected Behavior
Optional-unwrapping
if
should always require a capture, as it does in runtime code.IMO this should count as a miscompilation, since invalid code (where the intent is not clear) is processed (and yields an unintuitive result).
The text was updated successfully, but these errors were encountered: