aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/union_enum_field_missing.zig
blob: 81bc83cf181d959f9519e9900650eb0110c49812 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const E = enum {
    a,
    b,
    c,
};

const U = union(E) {
    a: i32,
    b: f64,
};

export fn entry() usize {
    return @sizeOf(U);
}

// error
// target=native
//
// :7:11: error: enum field(s) missing in union
// :4:5: note: field 'c' missing, declared here
// :1:11: note: enum declared here