zig/test/behavior/bugs/12723.zig
2022-12-06 19:06:48 -07:00

9 lines
280 B
Zig

const expect = @import("std").testing.expect;
test "Non-exhaustive enum backed by comptime_int" {
const E = enum(comptime_int) { a, b, c, _ };
comptime var e: E = .a;
e = @intToEnum(E, 378089457309184723749);
try expect(@enumToInt(e) == 378089457309184723749);
}