zig/doc/langref/test_comptime_invalid_error_set_cast.zig

14 lines
190 B
Zig

const Set1 = error{
A,
B,
};
const Set2 = error{
A,
C,
};
comptime {
_ = @as(Set2, @errorCast(Set1.B));
}
// test_error='error.B' not a member of error set 'error{A,C}'