This logic was previously in Sema, which was unnecessary complexity, and meant the issue was not detected unless the declaration was semantically analyzed. This commit finishes the work which 941090d started.
Resolves: #17916
17 lines
270 B
Zig
17 lines
270 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 name
|
|
// :3:5: note: duplicate field here
|
|
// :1:11: note: struct declared here
|