| ... | ... | @@ -2765,8 +2765,9 @@ pub fn indexToKey(ip: *const InternPool, index: Index) Key { |
| 2765 | 2765 | .func => .{ .func = ip.extraData(Key.Func, data) }, |
| 2766 | 2766 | .only_possible_value => { |
| 2767 | 2767 | const ty = @intToEnum(Index, data); |
| 2768 | | return switch (ip.indexToKey(ty)) { |
| 2769 | | .array_type, .vector_type => .{ .aggregate = .{ |
| 2768 | const ty_item = ip.items.get(@enumToInt(ty)); |
| 2769 | return switch (ty_item.tag) { |
| 2770 | .type_array_big, .type_array_small, .type_vector => .{ .aggregate = .{ |
| 2770 | 2771 | .ty = ty, |
| 2771 | 2772 | .storage = .{ .elems = &.{} }, |
| 2772 | 2773 | } }, |
| ... | ... | @@ -2775,16 +2776,23 @@ pub fn indexToKey(ip: *const InternPool, index: Index) Key { |
| 2775 | 2776 | // have a slice of comptime values that can be used here for when |
| 2776 | 2777 | // the struct has one possible value due to all fields comptime (same |
| 2777 | 2778 | // as the tuple case below). |
| 2778 | | .struct_type => .{ .aggregate = .{ |
| 2779 | .type_struct, .type_struct_ns => .{ .aggregate = .{ |
| 2779 | 2780 | .ty = ty, |
| 2780 | 2781 | .storage = .{ .elems = &.{} }, |
| 2781 | 2782 | } }, |
| 2783 | |
| 2782 | 2784 | // There is only one possible value precisely due to the |
| 2783 | 2785 | // fact that this values slice is fully populated! |
| 2784 | | .anon_struct_type => |anon_struct_type| .{ .aggregate = .{ |
| 2785 | | .ty = ty, |
| 2786 | | .storage = .{ .elems = anon_struct_type.values }, |
| 2787 | | } }, |
| 2786 | .type_struct_anon, .type_tuple_anon => { |
| 2787 | const type_struct_anon = ip.extraDataTrail(TypeStructAnon, ty_item.data); |
| 2788 | const fields_len = type_struct_anon.data.fields_len; |
| 2789 | const values = ip.extra.items[type_struct_anon.end + fields_len ..][0..fields_len]; |
| 2790 | return .{ .aggregate = .{ |
| 2791 | .ty = ty, |
| 2792 | .storage = .{ .elems = @ptrCast([]const Index, values) }, |
| 2793 | } }; |
| 2794 | }, |
| 2795 | |
| 2788 | 2796 | else => unreachable, |
| 2789 | 2797 | }; |
| 2790 | 2798 | }, |