aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/union_extra_field.zig
blob: df65ab2dc620d4327f85eba5d438fe178978dc02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
const E = enum {
    a,
    b,
    c,
};
const U = union(E) {
    a: i32,
    b: f64,
    c: f64,
    d: f64,
};
export fn entry() usize {
    return @sizeOf(U);
}

// error
//
// :10:5: error: no field named 'd' in enum 'tmp.E'
// :1:11: note: enum declared here