aboutsummaryrefslogtreecommitdiff
path: root/doc/langref/test_comptime_invalid_error_set_cast.zig
blob: 0299f3b0b0b543dbf46747560593658ed87982d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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}'