| ... | @@ -26792,11 +26792,12 @@ fn coerceValueInMemory( | ... | @@ -26792,11 +26792,12 @@ fn coerceValueInMemory( |
| 26792 | else => unreachable, | 26792 | else => unreachable, |
| 26793 | }; | 26793 | }; |
| 26794 | if (src_ty_child != dst_ty_child) break :direct; | 26794 | if (src_ty_child != dst_ty_child) break :direct; |
| | 26795 | // TODO: write something like getCoercedInts to avoid needing to dupe |
| 26795 | return (try mod.intern(.{ .aggregate = .{ | 26796 | return (try mod.intern(.{ .aggregate = .{ |
| 26796 | .ty = dst_ty.toIntern(), | 26797 | .ty = dst_ty.toIntern(), |
| 26797 | .storage = switch (aggregate.storage) { | 26798 | .storage = switch (aggregate.storage) { |
| 26798 | .bytes => |bytes| .{ .bytes = bytes[0..dest_len] }, | 26799 | .bytes => |bytes| .{ .bytes = try sema.arena.dupe(u8, bytes[0..dest_len]) }, |
| 26799 | .elems => |elems| .{ .elems = elems[0..dest_len] }, | 26800 | .elems => |elems| .{ .elems = try sema.arena.dupe(InternPool.Index, elems[0..dest_len]) }, |
| 26800 | .repeated_elem => |elem| .{ .repeated_elem = elem }, | 26801 | .repeated_elem => |elem| .{ .repeated_elem = elem }, |
| 26801 | }, | 26802 | }, |
| 26802 | } })).toValue(); | 26803 | } })).toValue(); |