@enumFromInt
doesnt safety check out of range int on non-exhaustive enum
#21946
Labels
Milestone
@enumFromInt
doesnt safety check out of range int on non-exhaustive enum
#21946
Zig Version
0.14.0-dev.2162+3054486d1
Steps to Reproduce and Observed Behavior
this incorrectly passes and gives
b
an enum value of15
, just reinterpreting the lower bits. ifa
is comptime known it errors as expectedExpected Behavior
runtime panic
invalid enum value
The text was updated successfully, but these errors were encountered: