mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 22:04:21 +00:00
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 Foo = enum {
|
|
Bar,
|
|
Bar,
|
|
};
|
|
|
|
export fn entry() void {
|
|
const a: Foo = undefined;
|
|
_ = a;
|
|
}
|
|
|
|
// error
|
|
// backend=stage2
|
|
// target=native
|
|
//
|
|
// :2:5: error: duplicate enum field name
|
|
// :3:5: note: duplicate field here
|
|
// :1:13: note: enum declared here
|