aboutsummaryrefslogtreecommitdiff
path: root/src/type.zig
diff options
context:
space:
mode:
authormlugg <mlugg@mlugg.co.uk>2023-06-03 15:46:16 +0100
committerAndrew Kelley <andrew@ziglang.org>2023-06-10 20:51:10 -0700
commit2a6b91874ae970c0fba63f8c1357da5a57feec27 (patch)
treeccc245020664b0908c3e674295d3e1ca6e01bd10 /src/type.zig
parentab86b2024883f67c0fa06108f66e4e88b98c3163 (diff)
downloadzig-2a6b91874ae970c0fba63f8c1357da5a57feec27.tar.gz
zig-2a6b91874ae970c0fba63f8c1357da5a57feec27.zip
stage2: pass most test cases under InternPool
All but 2 test cases now pass (tested on x86_64 Linux, native only). The remaining two signify an issue requiring a larger refactor, which I will do in a separate commit. Notable changes: * Fix uninitialized memory when allocating objects from free lists * Implement TypedValue printing for pointers * Fix some TypedValue printing logic * Work around non-existence of InternPool.remove implementation
Diffstat (limited to 'src/type.zig')
-rw-r--r--src/type.zig3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/type.zig b/src/type.zig
index d9ae710b2d..a6997bc590 100644
--- a/src/type.zig
+++ b/src/type.zig
@@ -345,6 +345,9 @@ pub const Type = struct {
}
},
.anon_struct_type => |anon_struct| {
+ if (anon_struct.types.len == 0) {
+ return writer.writeAll("@TypeOf(.{})");
+ }
try writer.writeAll("struct{");
for (anon_struct.types, anon_struct.values, 0..) |field_ty, val, i| {
if (i != 0) try writer.writeAll(", ");