| ... | @@ -36641,11 +36641,11 @@ fn semaUnionFields(pt: Zcu.PerThread, arena: Allocator, union_ty: InternPool.Ind | ... | @@ -36641,11 +36641,11 @@ fn semaUnionFields(pt: Zcu.PerThread, arena: Allocator, union_ty: InternPool.Ind |
| 36641 | } | 36641 | } |
| 36642 | } else { | 36642 | } else { |
| 36643 | // The provided type is the enum tag type. | 36643 | // The provided type is the enum tag type. |
| 36644 | union_type.setTagType(ip, provided_ty.toIntern()); | | |
| 36645 | const enum_type = switch (ip.indexToKey(provided_ty.toIntern())) { | 36644 | const enum_type = switch (ip.indexToKey(provided_ty.toIntern())) { |
| 36646 | .enum_type => ip.loadEnumType(provided_ty.toIntern()), | 36645 | .enum_type => ip.loadEnumType(provided_ty.toIntern()), |
| 36647 | else => return sema.fail(&block_scope, tag_ty_src, "expected enum tag type, found '{}'", .{provided_ty.fmt(pt)}), | 36646 | else => return sema.fail(&block_scope, tag_ty_src, "expected enum tag type, found '{}'", .{provided_ty.fmt(pt)}), |
| 36648 | }; | 36647 | }; |
| | 36648 | union_type.setTagType(ip, provided_ty.toIntern()); |
| 36649 | // The fields of the union must match the enum exactly. | 36649 | // The fields of the union must match the enum exactly. |
| 36650 | // A flag per field is used to check for missing and extraneous fields. | 36650 | // A flag per field is used to check for missing and extraneous fields. |
| 36651 | explicit_tags_seen = try sema.arena.alloc(bool, enum_type.names.len); | 36651 | explicit_tags_seen = try sema.arena.alloc(bool, enum_type.names.len); |