aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/struct_duplicate_field_name.zig
blob: 7e4434f1d92fa353d9fccff5f2c403fae90c9978 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
const S = struct {
    foo: u32,
    foo: u32,
};

export fn entry() void {
    const s: S = .{ .foo = 100 };
    _ = s;
}

// error
// target=native
//
// :3:5: error: duplicate struct field: 'foo'
// :2:5: note: other field here
// :1:11: note: struct declared here