From 9d6bef49a5fc2a5387734fa8d8cc698f0da8d5fa Mon Sep 17 00:00:00 2001 From: Jimmi Holst Christensen Date: Fri, 7 Jan 2022 18:58:40 +0100 Subject: Add two more resolution status' to Struct and Union resolveTypeForCodegen is called when we needed to resolve a type fully, even through pointer. This commit fully implements this, even through pointer fields on structs and unions. The function has now also been renamed to resolveTypeFully --- src/type.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/type.zig') diff --git a/src/type.zig b/src/type.zig index 4ad15f2399..f4561769e2 100644 --- a/src/type.zig +++ b/src/type.zig @@ -1916,7 +1916,7 @@ pub const Type = extern union { const fields = self.structFields(); const is_packed = if (self.castTag(.@"struct")) |payload| p: { const struct_obj = payload.data; - assert(struct_obj.status == .have_layout); + assert(struct_obj.haveLayout()); break :p struct_obj.layout == .Packed; } else false; @@ -2220,7 +2220,7 @@ pub const Type = extern union { if (field_count == 0) return 0; const struct_obj = ty.castTag(.@"struct").?.data; - assert(struct_obj.status == .have_layout); + assert(struct_obj.haveLayout()); var total: u64 = 0; for (struct_obj.fields.values()) |field| { @@ -3771,7 +3771,7 @@ pub const Type = extern union { switch (ty.tag()) { .@"struct" => { const struct_obj = ty.castTag(.@"struct").?.data; - assert(struct_obj.status == .have_layout); + assert(struct_obj.haveLayout()); const is_packed = struct_obj.layout == .Packed; if (!is_packed) { var offset: u64 = 0; -- cgit v1.2.3