zig/test/cases/compile_errors/duplicate_union_field.zig
2022-06-30 09:57:38 +02:00

17 lines
282 B
Zig

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