@enumFromInt(@truncate(x))
should work
#20375
Labels
Milestone
@enumFromInt(@truncate(x))
should work
#20375
Zig Version
0.13.0-dev.351+64ef45eb0
Steps to Reproduce and Observed Behavior
This could also be seen as a proposal.
When I want to convert an integer to an enum and
@enumFromInt
knows the enum because of the: X
type annotation, it can know the result type of the@truncate
by looking at the tag type I specified for theX
enum.Currently this happens:
Similar to #18218
Expected Behavior
For the code above to compile.
The text was updated successfully, but these errors were encountered: