mirror of
https://github.com/ziglang/zig.git
synced 2024-11-30 09:02:32 +00:00
17 lines
229 B
Zig
17 lines
229 B
Zig
const std = @import("std");
|
|
|
|
const Foo = enum {
|
|
a,
|
|
b,
|
|
c,
|
|
};
|
|
|
|
pub fn main() void {
|
|
var a: u2 = 3;
|
|
_ = &a;
|
|
const b: Foo = @enumFromInt(a);
|
|
std.debug.print("value: {s}\n", .{@tagName(b)});
|
|
}
|
|
|
|
// exe=fail
|