Commit 80bf5af345
Changed files (2)
src/print_air.zig
@@ -621,7 +621,7 @@ const Writer = struct {
fn writeInterned(w: *Writer, s: anytype, inst: Air.Inst.Index) @TypeOf(s).Error!void {
const mod = w.module;
const ip_index = w.air.instructions.items(.data)[inst].interned;
- const ty = ip_index.toType();
+ const ty = mod.intern_pool.indexToKey(ip_index).typeOf().toType();
try w.writeType(s, ty);
try s.print(", {}", .{ip_index.toValue().fmtValue(ty, mod)});
}
src/TypedValue.zig
@@ -413,8 +413,12 @@ pub fn print(
.runtime_value => return writer.writeAll("[runtime value]"),
},
else => {
- try writer.print("(interned: {})", .{val.ip_index});
- return;
+ const key = mod.intern_pool.indexToKey(val.ip_index);
+ if (key.typeOf() == .type_type) {
+ return Type.print(val.toType(), writer, mod);
+ } else {
+ return writer.print("{}", .{val.ip_index});
+ }
},
};
}