Sema: validate @intToEnum int operand type
This commit is contained in:
16
test/cases/compile_errors/duplicate_enum_field.zig
Normal file
16
test/cases/compile_errors/duplicate_enum_field.zig
Normal file
@@ -0,0 +1,16 @@
|
||||
const Foo = enum {
|
||||
Bar,
|
||||
Bar,
|
||||
};
|
||||
|
||||
export fn entry() void {
|
||||
const a: Foo = undefined;
|
||||
_ = a;
|
||||
}
|
||||
|
||||
// error
|
||||
// backend=stage2
|
||||
// target=native
|
||||
//
|
||||
// :3:5: error: duplicate enum field 'Bar'
|
||||
// :2:5: note: other field here
|
||||
Reference in New Issue
Block a user