Skip to content

Commit 2d2fc90

Browse files
committed
Stops hashing types
1 parent 72c21dd commit 2d2fc90

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Sema/LowerZon.zig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,8 @@ fn lowerExprAnonResTy(self: *LowerZon, node: Zoir.Node.Index) CompileError!Inter
127127
},
128128
.struct_literal => |init| {
129129
const elems = try self.sema.arena.alloc(InternPool.Index, init.names.len);
130-
const types = try self.sema.arena.alloc(InternPool.Index, init.names.len);
131130
for (0..init.names.len) |i| {
132131
elems[i] = try self.lowerExprAnonResTy(init.vals.at(@intCast(i)));
133-
types[i] = Value.fromInterned(elems[i]).typeOf(pt.zcu).toIntern();
134132
}
135133
const struct_ty = switch (try ip.getStructType(
136134
gpa,
@@ -150,7 +148,6 @@ fn lowerExprAnonResTy(self: *LowerZon, node: Zoir.Node.Index) CompileError!Inter
150148
var hasher: std.hash.Wyhash = .init(0);
151149
hasher.update(std.mem.asBytes(&node));
152150
hasher.update(std.mem.sliceAsBytes(elems));
153-
hasher.update(std.mem.sliceAsBytes(types));
154151
hasher.update(std.mem.sliceAsBytes(init.names));
155152
break :hash hasher.final();
156153
},
@@ -182,7 +179,10 @@ fn lowerExprAnonResTy(self: *LowerZon, node: Zoir.Node.Index) CompileError!Inter
182179
}
183180

184181
@memcpy(struct_type.field_inits.get(ip), elems);
185-
@memcpy(struct_type.field_types.get(ip), types);
182+
const types = struct_type.field_types.get(ip);
183+
for (0..init.names.len) |i| {
184+
types[i] = Value.fromInterned(elems[i]).typeOf(pt.zcu).toIntern();
185+
}
186186

187187
const new_namespace_index = try pt.createNamespace(.{
188188
.parent = self.block.namespace.toOptional(),

0 commit comments

Comments
 (0)