Files
zig/test/cases/compile_errors/struct_duplicate_field_name.zig
2023-11-16 14:38:16 +00:00

17 lines
268 B
Zig

const S = struct {
foo: u32,
foo: u32,
};
export fn entry() void {
const s: S = .{ .foo = 100 };
_ = s;
}
// error
// target=native
//
// :2:5: error: duplicate struct field: 'foo'
// :3:5: note: other field here
// :1:11: note: struct declared here