7dd3c3814d
closes #1442 zig needed to insert explicit padding into this structure before it got bitcasted.
12 lines
281 B
Zig
12 lines
281 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);
|
|
}
|