Migrated from: https://github.com/ziglang/zig/issues/18882
Accepted proposal (as per this comment):
- Remove
@intFromEnum, replacing it with a new builtin @backingInt. That builtin accepts enums and bitpacks (packed struct/packed union).
- Remove
@enumFromInt, replacing it with a new builtin @fromBackingInt. That builtin can return enums and bitpacks (packed struct/packed union).
- Allow
@bitCast to accept and/or return enum types. This accepts the sub-proposal given in this comment.
This also effectively accepts https://github.com/ziglang/zig/issues/22712, because @fromBackingInt will provide a result type to its operand.
Migrated from: https://github.com/ziglang/zig/issues/18882
---
Accepted proposal (as per [this comment](https://github.com/ziglang/zig/issues/18882#issuecomment-4361640243)):
- Remove `@intFromEnum`, replacing it with a new builtin `@backingInt`. That builtin accepts enums and bitpacks (packed struct/packed union).
- Remove `@enumFromInt`, replacing it with a new builtin `@fromBackingInt`. That builtin can return enums and bitpacks (packed struct/packed union).
- Allow `@bitCast` to accept and/or return enum types. This accepts the sub-proposal given in [this comment](https://github.com/ziglang/zig/issues/14367#issuecomment-4316671616).
This also effectively accepts https://github.com/ziglang/zig/issues/22712, because `@fromBackingInt` will provide a result type to its operand.