zig/test/cases/enum_values.0.zig

19 lines
313 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 = @intToEnum(Number, 2);
if (@enumToInt(number3) != 2) {
unreachable;
}
return;
}
// run
//