sema: resolve{Struct,Union}Inner don't throw away Semas

before this, calls to `resolveTypeFieldsStruct` (now renamed to the more correct `resolveStructFieldTypes`) would just throw away the sema that `resolveStructInner` created and create its own. There is no reason to do this, and we fix it to preserve the sema through it all.
This commit is contained in:
David Rubin
2024-08-12 15:28:05 -07:00
parent 472f3ac419
commit ce92ccccc9
4 changed files with 64 additions and 87 deletions

View File

@@ -457,7 +457,7 @@ pub const Cau = struct {
unwrapped.index);
}
};
fn unwrap(cau_index: Cau.Index, ip: *const InternPool) Unwrapped {
pub fn unwrap(cau_index: Cau.Index, ip: *const InternPool) Unwrapped {
return .{
.tid = @enumFromInt(@intFromEnum(cau_index) >> ip.tid_shift_31 & ip.getTidMask()),
.index = @intFromEnum(cau_index) & ip.getIndexMask(u31),
@@ -1464,7 +1464,7 @@ pub const NamespaceIndex = enum(u32) {
unwrapped.index);
}
};
fn unwrap(namespace_index: NamespaceIndex, ip: *const InternPool) Unwrapped {
pub fn unwrap(namespace_index: NamespaceIndex, ip: *const InternPool) Unwrapped {
const index = @intFromEnum(namespace_index) & ip.getIndexMask(u32);
return .{
.tid = @enumFromInt(@intFromEnum(namespace_index) >> ip.tid_shift_32 & ip.getTidMask()),