master
 1const std = @import("std");
 2
 3const Set1 = error{
 4    A,
 5    B,
 6};
 7const Set2 = error{
 8    A,
 9    C,
10};
11pub fn main() void {
12    foo(Set1.B);
13}
14fn foo(set1: Set1) void {
15    const x: Set2 = @errorCast(set1);
16    std.debug.print("value: {}\n", .{x});
17}
18
19// exe=fail