aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/duplicate_union_field.zig
blob: 6a0265dd0294d5c6ba8dd334eea382cfa3363087 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
const Foo = union {
    Bar: i32,
    Bar: usize,
};
export fn entry() void {
    const a: Foo = undefined;
    _ = a;
}

// error
// backend=stage2
// target=native
//
// :3:5: error: duplicate union field: 'Bar'
// :2:5: note: other field here
// :1:13: note: union declared here