mirror of
https://github.com/ziglang/zig.git
synced 2026-01-05 21:13:24 +00:00
Changed container and initializer syntax
* <container> { ... } -> <container> . { ... }
* <exrp> { ... } -> <expr> . { ...}
12 lines
282 B
Zig
12 lines
282 B
Zig
const std = @import("std");
|
|
|
|
const Union = union(enum).{
|
|
Text: []const u8,
|
|
Color: u32,
|
|
};
|
|
|
|
test "const error union field alignment" {
|
|
var union_or_err: error!Union = Union.{ .Color = 1234 };
|
|
std.debug.assertOrPanic((union_or_err catch unreachable).Color == 1234);
|
|
}
|