@@ -127,10 +127,8 @@ fn lowerExprAnonResTy(self: *LowerZon, node: Zoir.Node.Index) CompileError!Inter
127
127
},
128
128
.struct_literal = > | init | {
129
129
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 );
131
130
for (0.. init .names .len ) | i | {
132
131
elems [i ] = try self .lowerExprAnonResTy (init .vals .at (@intCast (i )));
133
- types [i ] = Value .fromInterned (elems [i ]).typeOf (pt .zcu ).toIntern ();
134
132
}
135
133
const struct_ty = switch (try ip .getStructType (
136
134
gpa ,
@@ -150,7 +148,6 @@ fn lowerExprAnonResTy(self: *LowerZon, node: Zoir.Node.Index) CompileError!Inter
150
148
var hasher : std.hash.Wyhash = .init (0 );
151
149
hasher .update (std .mem .asBytes (& node ));
152
150
hasher .update (std .mem .sliceAsBytes (elems ));
153
- hasher .update (std .mem .sliceAsBytes (types ));
154
151
hasher .update (std .mem .sliceAsBytes (init .names ));
155
152
break :hash hasher .final ();
156
153
},
@@ -182,7 +179,10 @@ fn lowerExprAnonResTy(self: *LowerZon, node: Zoir.Node.Index) CompileError!Inter
182
179
}
183
180
184
181
@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
+ }
186
186
187
187
const new_namespace_index = try pt .createNamespace (.{
188
188
.parent = self .block .namespace .toOptional (),
0 commit comments