aboutsummaryrefslogtreecommitdiff
path: root/src/Sema.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/Sema.zig')
-rw-r--r--src/Sema.zig5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Sema.zig b/src/Sema.zig
index edfd1d36e3..74e40687f1 100644
--- a/src/Sema.zig
+++ b/src/Sema.zig
@@ -30757,16 +30757,17 @@ fn generateUnionTagTypeNumbered(
new_decl.name_fully_qualified = true;
errdefer mod.abortAnonDecl(new_decl_index);
+ const copied_int_ty = try int_ty.copy(new_decl_arena_allocator);
enum_obj.* = .{
.owner_decl = new_decl_index,
- .tag_ty = int_ty,
+ .tag_ty = copied_int_ty,
.fields = .{},
.values = .{},
};
// Here we pre-allocate the maps using the decl arena.
try enum_obj.fields.ensureTotalCapacity(new_decl_arena_allocator, fields_len);
try enum_obj.values.ensureTotalCapacityContext(new_decl_arena_allocator, fields_len, .{
- .ty = int_ty,
+ .ty = copied_int_ty,
.mod = mod,
});
try new_decl.finalizeNewArena(&new_decl_arena);