Files
zig/test/cases/compile_errors/empty_extern_union.zig
T
Matthew Lugg 4f7344dec0 tests: update for accepted language change
Unions with no fields are now "uninstantiable" types, which work like
`noreturn` in that values of this type cannot exist. Enums with no
fields are different because they are currently considered `extern`
types, though https://github.com/ziglang/zig/issues/19855 will change
this in the future.
2026-03-10 10:26:10 +00:00

9 lines
140 B
Zig

export fn foo() void {
const U = extern union {};
_ = @as(U, undefined);
}
// error
//
// :2:22: error: extern union has no fields