aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/union_extra_field.zig
blob: 6d1c644bc6888e64140a2ce870d2b68c8b076982 (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,
    c: f64,
    d: f64,
};
export fn entry() usize {
    return @sizeOf(U);
}

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