| ... | ... | @@ -3859,7 +3859,7 @@ pub fn indexToKey(ip: *const InternPool, index: Index) Key { |
| 3859 | 3859 | .func_decl => .{ .func = ip.extraFuncDecl(data) }, |
| 3860 | 3860 | .func_coerced => .{ .func = ip.extraFuncCoerced(data) }, |
| 3861 | 3861 | .only_possible_value => { |
| 3862 | | const ty = @as(Index, @enumFromInt(data)); |
| 3862 | const ty: Index = @enumFromInt(data); |
| 3863 | 3863 | const ty_item = ip.items.get(@intFromEnum(ty)); |
| 3864 | 3864 | return switch (ty_item.tag) { |
| 3865 | 3865 | .type_array_big => { |
| ... | ... | @@ -3872,20 +3872,33 @@ pub fn indexToKey(ip: *const InternPool, index: Index) Key { |
| 3872 | 3872 | .storage = .{ .elems = sentinel[0..@intFromBool(sentinel[0] != .none)] }, |
| 3873 | 3873 | } }; |
| 3874 | 3874 | }, |
| 3875 | | .type_array_small, .type_vector => .{ .aggregate = .{ |
| 3876 | | .ty = ty, |
| 3877 | | .storage = .{ .elems = &.{} }, |
| 3878 | | } }, |
| 3879 | | // TODO: migrate structs to properly use the InternPool rather |
| 3880 | | // than using the SegmentedList trick, then the struct type will |
| 3881 | | // have a slice of comptime values that can be used here for when |
| 3882 | | // the struct has one possible value due to all fields comptime (same |
| 3883 | | // as the tuple case below). |
| 3884 | | .type_struct, .type_struct_ns => .{ .aggregate = .{ |
| 3875 | .type_array_small, |
| 3876 | .type_vector, |
| 3877 | .type_struct_ns, |
| 3878 | .type_struct_packed, |
| 3879 | => .{ .aggregate = .{ |
| 3885 | 3880 | .ty = ty, |
| 3886 | 3881 | .storage = .{ .elems = &.{} }, |
| 3887 | 3882 | } }, |
| 3888 | 3883 | |
| 3884 | // There is only one possible value precisely due to the |
| 3885 | // fact that this values slice is fully populated! |
| 3886 | .type_struct => { |
| 3887 | const info = extraStructType(ip, ty_item.data); |
| 3888 | return .{ .aggregate = .{ |
| 3889 | .ty = ty, |
| 3890 | .storage = .{ .elems = @ptrCast(info.field_inits.get(ip)) }, |
| 3891 | } }; |
| 3892 | }, |
| 3893 | |
| 3894 | .type_struct_packed_inits => { |
| 3895 | const info = extraPackedStructType(ip, ty_item.data, true); |
| 3896 | return .{ .aggregate = .{ |
| 3897 | .ty = ty, |
| 3898 | .storage = .{ .elems = @ptrCast(info.field_inits.get(ip)) }, |
| 3899 | } }; |
| 3900 | }, |
| 3901 | |
| 3889 | 3902 | // There is only one possible value precisely due to the |
| 3890 | 3903 | // fact that this values slice is fully populated! |
| 3891 | 3904 | .type_struct_anon, .type_tuple_anon => { |
| ... | ... | @@ -3898,11 +3911,6 @@ pub fn indexToKey(ip: *const InternPool, index: Index) Key { |
| 3898 | 3911 | } }; |
| 3899 | 3912 | }, |
| 3900 | 3913 | |
| 3901 | | .type_struct_packed, .type_struct_packed_inits => { |
| 3902 | | // a packed struct has a 0-bit backing type |
| 3903 | | @panic("TODO"); |
| 3904 | | }, |
| 3905 | | |
| 3906 | 3914 | .type_enum_auto, |
| 3907 | 3915 | .type_enum_explicit, |
| 3908 | 3916 | .type_union, |