stage2: fix struct inits not getting fields resolved

This commit is contained in:
Andrew Kelley
2021-05-07 22:16:15 -07:00
parent 73bf53069d
commit 28353b3159
4 changed files with 15 additions and 11 deletions

View File

@@ -4416,7 +4416,9 @@ pub fn analyzeStructFields(mod: *Module, struct_obj: *Struct) InnerError!void {
};
defer assert(block.instructions.items.len == 0); // should all be comptime instructions
_ = try sema.analyzeBody(&block, body);
if (body.len != 0) {
_ = try sema.analyzeBody(&block, body);
}
const bits_per_field = 4;
const fields_per_u32 = 32 / bits_per_field;
@@ -4545,7 +4547,9 @@ pub fn analyzeUnionFields(mod: *Module, union_obj: *Union) InnerError!void {
};
defer assert(block.instructions.items.len == 0); // should all be comptime instructions
_ = try sema.analyzeBody(&block, body);
if (body.len != 0) {
_ = try sema.analyzeBody(&block, body);
}
var auto_enum_tag: ?bool = null;