mirror of
https://github.com/ziglang/zig.git
synced 2024-11-27 07:32:44 +00:00
12 lines
191 B
Zig
12 lines
191 B
Zig
|
comptime {
|
||
|
var f = Foo{ .int = 42 };
|
||
|
f.float = 12.34;
|
||
|
}
|
||
|
|
||
|
const Foo = union {
|
||
|
float: f32,
|
||
|
int: u32,
|
||
|
};
|
||
|
|
||
|
// test_error=access of union field 'float' while field 'int' is active
|