Files
zig/test/cases/compile_errors/int_from_enum_undefined.zig
Veikka Tuominen 51d67c7c8f Sema: add declared here notes in fail
This ensures that the note is added in more places and that `errMsg` needs to be used in fewer places.
2024-02-12 12:54:32 -08:00

14 lines
257 B
Zig

export fn a() void {
const E = enum {};
var e: E = undefined;
_ = &e;
_ = @intFromEnum(e);
}
// error
// backend=stage2
// target=native
//
// :5:22: error: cannot use @intFromEnum on empty enum 'tmp.a.E'
// :2:15: note: enum declared here