From dad8757d3ad3fe773f7c008493144b8e176d7bed Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Sat, 15 Oct 2022 07:55:15 -0700 Subject: [PATCH] ecs: remove stage1 compiler bug workaround Signed-off-by: Stephen Gutekanst --- libs/ecs/src/systems.zig | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/libs/ecs/src/systems.zig b/libs/ecs/src/systems.zig index f08e0bb2..260a626b 100644 --- a/libs/ecs/src/systems.zig +++ b/libs/ecs/src/systems.zig @@ -47,23 +47,14 @@ pub fn Messages(comptime messages: anytype) type { }}; } - // TODO(self-hosted): check if we can remove this now - // Hack to workaround stage1 compiler bug. https://github.com/ziglang/zig/issues/8114 - // - // return @Type(.{ - // .Union = .{ - // .layout = .Auto, - // .tag_type = MessagesTag(messages), - // .fields = fields, - // .decls = &[_]std.builtin.Type.Declaration{}, - // }, - // }); - // - const Ref = union(enum) { temp }; - var info = @typeInfo(Ref); - info.Union.tag_type = MessagesTag(messages); - info.Union.fields = fields; - return @Type(info); + return @Type(.{ + .Union = .{ + .layout = .Auto, + .tag_type = MessagesTag(messages), + .fields = fields, + .decls = &[_]std.builtin.Type.Declaration{}, + }, + }); } /// Returns the tag enum for a tagged union representing the messages, turning this: