aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/reified_enum_field_value_overflow.zig
blob: c28ae3f5fc207632c87aca0b255f7465ec82248c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
comptime {
    const E = @Type(.{ .@"enum" = .{
        .tag_type = u1,
        .fields = &.{
            .{ .name = "f0", .value = 0 },
            .{ .name = "f1", .value = 1 },
            .{ .name = "f2", .value = 2 },
        },
        .decls = &.{},
        .is_exhaustive = true,
    } });
    _ = E;
}

// error
//
// :2:15: error: field 'f2' with enumeration value '2' is too large for backing int type 'u1'