mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-09 15:19:07 +00:00
20 lines
281 B
Zig
20 lines
281 B
Zig
const E = enum {
|
|
a,
|
|
b,
|
|
c,
|
|
};
|
|
const U = union(E) {
|
|
a: i32,
|
|
b: f64,
|
|
c: f64,
|
|
d: f64,
|
|
};
|
|
export fn entry() usize {
|
|
return @sizeOf(U);
|
|
}
|
|
|
|
// error
|
|
// target=native
|
|
//
|
|
// :10:5: error: no field named 'd' in enum 'tmp.E'
|
|
// :1:11: note: enum declared here
|