From c30106c90665079f525129e344cc1c13e4db162b Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sun, 5 Jan 2020 17:42:03 -0500 Subject: [PATCH] add test case to cover already-solved bug closes #2401 --- test/stage1/behavior/union.zig | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/stage1/behavior/union.zig b/test/stage1/behavior/union.zig index d831b51b08..a977e31853 100644 --- a/test/stage1/behavior/union.zig +++ b/test/stage1/behavior/union.zig @@ -611,3 +611,12 @@ test "function call result coerces from tagged union to the tag" { S.doTheTest(); comptime S.doTheTest(); } + +test "0-sized extern union definition" { + const U = extern union { + a: void, + const f = 1; + }; + + expect(U.f == 1); +}