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