| ... | ... | @@ -4134,7 +4134,7 @@ fn unionDeclInner( |
| 4134 | 4134 | if (member.comptime_token) |comptime_token| { |
| 4135 | 4135 | return astgen.failTok(comptime_token, "union fields cannot be marked comptime", .{}); |
| 4136 | 4136 | } |
| 4137 | | try fields_data.ensureUnusedCapacity(gpa, if (node_tags[member.ast.type_expr] != .@"anytype") 4 else 3); |
| 4137 | try fields_data.ensureUnusedCapacity(gpa, 4); |
| 4138 | 4138 | |
| 4139 | 4139 | const field_name = try astgen.identAsString(member.ast.name_token); |
| 4140 | 4140 | fields_data.appendAssumeCapacity(field_name); |
| ... | ... | @@ -4149,8 +4149,11 @@ fn unionDeclInner( |
| 4149 | 4149 | (@as(u32, @boolToInt(have_value)) << 30) | |
| 4150 | 4150 | (@as(u32, @boolToInt(unused)) << 31); |
| 4151 | 4151 | |
| 4152 | | if (have_type and node_tags[member.ast.type_expr] != .@"anytype") { |
| 4153 | | const field_type = try typeExpr(&block_scope, &namespace.base, member.ast.type_expr); |
| 4152 | if (have_type) { |
| 4153 | const field_type: Zir.Inst.Ref = if (node_tags[member.ast.type_expr] == .@"anytype") |
| 4154 | .none |
| 4155 | else |
| 4156 | try typeExpr(&block_scope, &namespace.base, member.ast.type_expr); |
| 4154 | 4157 | fields_data.appendAssumeCapacity(@enumToInt(field_type)); |
| 4155 | 4158 | } |
| 4156 | 4159 | if (have_align) { |