zig/test/cases/enum_values.0.zig
mlugg f26dda2117 all: migrate code to new cast builtin syntax
Most of this migration was performed automatically with `zig fmt`. There
were a few exceptions which I had to manually fix:

* `@alignCast` and `@addrSpaceCast` cannot be automatically rewritten
* `@truncate`'s fixup is incorrect for vectors
* Test cases are not formatted, and their error locations change
2023-06-24 16:56:39 -07:00

19 lines
317 B
Zig

const Number = enum { One, Two, Three };
pub fn main() void {
var number1 = Number.One;
var number2: Number = .Two;
if (false) {
number1;
number2;
}
const number3: Number = @enumFromInt(2);
if (@intFromEnum(number3) != 2) {
unreachable;
}
return;
}
// run
//