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

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

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

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