zig/test/behavior/bugs/1442.zig
Andrew Kelley adb746a701 stage2: improved handling of store_to_block_ptr
* AstGen: remove the setBlockBodyEliding function. This is no longer
   needed after 63788b2a511eb87974065a052e2436b0c6202544.
 * Sema: store_to_block_ptr instruction is handled as
   store_to_inferred_ptr or store, as necessary.
2022-02-24 22:28:37 -07:00

13 lines
319 B
Zig

const std = @import("std");
const builtin = @import("builtin");
const Union = union(enum) {
Text: []const u8,
Color: u32,
};
test "const error union field alignment" {
var union_or_err: anyerror!Union = Union{ .Color = 1234 };
try std.testing.expect((union_or_err catch unreachable).Color == 1234);
}