2017-12-04 09:43:56 +08:00
|
|
|
const E = union(enum) { A: [9]u8, B: u64, };
|
2017-10-01 06:58:41 +08:00
|
|
|
const S = struct { x: u8, y: E, };
|
|
|
|
|
|
|
|
const assert = @import("std").debug.assert;
|
|
|
|
|
|
|
|
test "bug 394 fixed" {
|
2017-12-04 09:43:56 +08:00
|
|
|
const x = S { .x = 3, .y = E {.B = 1 } };
|
2017-10-01 06:58:41 +08:00
|
|
|
assert(x.x == 3);
|
|
|
|
}
|