| ... | ... | @@ -537,7 +537,7 @@ pub fn formatType( |
| 537 | 537 | .Fn => { |
| 538 | 538 | return format(writer, "{}@{x}", .{ @typeName(T), @ptrToInt(value) }); |
| 539 | 539 | }, |
| 540 | | .Type => return writer.writeAll(@typeName(T)), |
| 540 | .Type => return formatBuf(@typeName(value), options, writer), |
| 541 | 541 | .EnumLiteral => { |
| 542 | 542 | const buffer = [_]u8{'.'} ++ @tagName(value); |
| 543 | 543 | return formatType(buffer, fmt, options, writer, max_depth); |
| ... | ... | @@ -2052,6 +2052,12 @@ test "null" { |
| 2052 | 2052 | try testFmt("null", "{}", .{inst}); |
| 2053 | 2053 | } |
| 2054 | 2054 | |
| 2055 | test "type" { |
| 2056 | try testFmt("u8", "{}", .{u8}); |
| 2057 | try testFmt("?f32", "{}", .{?f32}); |
| 2058 | try testFmt("[]const u8", "{}", .{[]const u8}); |
| 2059 | } |
| 2060 | |
| 2055 | 2061 | test "named arguments" { |
| 2056 | 2062 | try testFmt("hello world!", "{} world{c}", .{ "hello", '!' }); |
| 2057 | 2063 | try testFmt("hello world!", "{[greeting]} world{[punctuation]c}", .{ .punctuation = '!', .greeting = "hello" }); |