diff options
| author | mlugg <mlugg@mlugg.co.uk> | 2023-06-03 15:46:16 +0100 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-06-10 20:51:10 -0700 |
| commit | 2a6b91874ae970c0fba63f8c1357da5a57feec27 (patch) | |
| tree | ccc245020664b0908c3e674295d3e1ca6e01bd10 /src/type.zig | |
| parent | ab86b2024883f67c0fa06108f66e4e88b98c3163 (diff) | |
| download | zig-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.zig | 3 |
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(", "); |
