Commit 7d9cf156c3

Andrew Kelley <andrew@ziglang.org>
2023-09-21 05:04:55
TypedValue: fix crash for tuples when printing
1 parent dca17d3
Changed files (1)
src/TypedValue.zig
@@ -437,7 +437,7 @@ fn printAggregate(
             if (i != 0) try writer.writeAll(", ");
 
             const field_name = switch (ip.indexToKey(ty.toIntern())) {
-                .struct_type => |x| x.field_names.get(ip)[i].toOptional(),
+                .struct_type => |x| x.fieldName(ip, i),
                 .anon_struct_type => |x| if (x.isTuple()) .none else x.names.get(ip)[i].toOptional(),
                 else => unreachable,
             };