aboutsummaryrefslogtreecommitdiff
path: root/src/type.zig
diff options
context:
space:
mode:
authormlugg <mlugg@mlugg.co.uk>2024-03-26 05:51:34 +0000
committermlugg <mlugg@mlugg.co.uk>2024-03-26 13:48:07 +0000
commit2a245e3b78890e5d1b65492e51d9fe509ec35b3c (patch)
tree00e839ff9a0ae4a871d282b4e86fbd9baeab701a /src/type.zig
parenta61def10c66abc871f92c84d9cef85b6b7752cbf (diff)
downloadzig-2a245e3b78890e5d1b65492e51d9fe509ec35b3c.tar.gz
zig-2a245e3b78890e5d1b65492e51d9fe509ec35b3c.zip
compiler: eliminate TypedValue
The only logic which remained in this file was the Value printing logic. This has been moved into a new `print_value.zig`.
Diffstat (limited to 'src/type.zig')
-rw-r--r--src/type.zig8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/type.zig b/src/type.zig
index 5d67f13cbd..203ab4f63e 100644
--- a/src/type.zig
+++ b/src/type.zig
@@ -187,8 +187,8 @@ pub const Type = struct {
if (info.sentinel != .none) switch (info.flags.size) {
.One, .C => unreachable,
- .Many => try writer.print("[*:{}]", .{Value.fromInterned(info.sentinel).fmtValue(Type.fromInterned(info.child), mod)}),
- .Slice => try writer.print("[:{}]", .{Value.fromInterned(info.sentinel).fmtValue(Type.fromInterned(info.child), mod)}),
+ .Many => try writer.print("[*:{}]", .{Value.fromInterned(info.sentinel).fmtValue(mod)}),
+ .Slice => try writer.print("[:{}]", .{Value.fromInterned(info.sentinel).fmtValue(mod)}),
} else switch (info.flags.size) {
.One => try writer.writeAll("*"),
.Many => try writer.writeAll("[*]"),
@@ -234,7 +234,7 @@ pub const Type = struct {
} else {
try writer.print("[{d}:{}]", .{
array_type.len,
- Value.fromInterned(array_type.sentinel).fmtValue(Type.fromInterned(array_type.child), mod),
+ Value.fromInterned(array_type.sentinel).fmtValue(mod),
});
try print(Type.fromInterned(array_type.child), writer, mod);
}
@@ -352,7 +352,7 @@ pub const Type = struct {
try print(Type.fromInterned(field_ty), writer, mod);
if (val != .none) {
- try writer.print(" = {}", .{Value.fromInterned(val).fmtValue(Type.fromInterned(field_ty), mod)});
+ try writer.print(" = {}", .{Value.fromInterned(val).fmtValue(mod)});
}
}
try writer.writeAll("}");