mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
12 lines
208 B
Zig
12 lines
208 B
Zig
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'
|