zig/test/behavior/bugs/1442.zig
Andrew Kelley 4307436b99 move behavior tests from test/stage1/ to test/
And fix test cases to make them pass. This is in preparation for
starting to pass behavior tests with self-hosted.
2021-04-29 15:54:04 -07:00

12 lines
279 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: anyerror!Union = Union{ .Color = 1234 };
std.testing.expect((union_or_err catch unreachable).Color == 1234);
}