mirror of
https://github.com/ziglang/zig.git
synced 2024-11-30 09:02:32 +00:00
20 lines
264 B
Zig
20 lines
264 B
Zig
const std = @import("std");
|
|
|
|
const Set1 = error{
|
|
A,
|
|
B,
|
|
};
|
|
const Set2 = error{
|
|
A,
|
|
C,
|
|
};
|
|
pub fn main() void {
|
|
foo(Set1.B);
|
|
}
|
|
fn foo(set1: Set1) void {
|
|
const x: Set2 = @errorCast(set1);
|
|
std.debug.print("value: {}\n", .{x});
|
|
}
|
|
|
|
// exe=fail
|