authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-01-05 17:42:03-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-01-05 17:42:03-05:00
logc30106c90665079f525129e344cc1c13e4db162b
treedddc37cbbb7aa5ebf7e456114d4532d2a82915c4
parent6ff70d3c31607abfab7b0641bb903859972a6a8b
signaturelock-open Commit is signed but in an unrecognized format.

add test case to cover already-solved bug

closes #2401

1 files changed, 9 insertions(+), 0 deletions(-)

test/stage1/behavior/union.zig+9
...@@ -611,3 +611,12 @@ test "function call result coerces from tagged union to the tag" {...@@ -611,3 +611,12 @@ test "function call result coerces from tagged union to the tag" {
611 S.doTheTest();611 S.doTheTest();
612 comptime S.doTheTest();612 comptime S.doTheTest();
613}613}
614
615test "0-sized extern union definition" {
616 const U = extern union {
617 a: void,
618 const f = 1;
619 };
620
621 expect(U.f == 1);
622}