aboutsummaryrefslogtreecommitdiff
path: root/doc/langref/test_comptime_invalid_enum_cast.zig
blob: 8371091fe1f26bddb2d90e699c65ae65a3f7aa9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
const Foo = enum {
    a,
    b,
    c,
};
comptime {
    const a: u2 = 3;
    const b: Foo = @enumFromInt(a);
    _ = b;
}

// test_error=enum 'test_comptime_invalid_enum_cast.Foo' has no tag with value '3'