Open jrfondren opened 1 year ago
I believe you need to refer to the enum value like C = A | B
package main
Flags :: bit_set[Flags; u8]
main :: proc() {
fl: Flags
}
This code results in the same error and segmentation fault (Linux and Windows) Odin: dev-2023-10 OS: Windows 10 Unknown Edition (00000064) (version: 22H2), build 19045.3570 CPU: Intel(R) Core(TM) i3-7100U CPU @ 2.40GHz RAM: 16253 MiB
The bug is a bug, but I'll post a workaround for the original problem, just in case anyone stumbles upon it. You can re-use existing enum values like this:
E :: enum {
A = 0,
B = 1,
C = A | B,
}
I'm pretty sure the same issue appears if you use implicit secectors (e.g. .A
) too
Context
With latest Odin
and this invalid program:
Expected Behavior
An error, or acceptance with
C = 0|1
Current Behavior