| ... | @@ -327,7 +327,7 @@ pub fn formatType( | ... | @@ -327,7 +327,7 @@ pub fn formatType( |
| 327 | max_depth: usize, | 327 | max_depth: usize, |
| 328 | ) @TypeOf(writer).Error!void { | 328 | ) @TypeOf(writer).Error!void { |
| 329 | if (comptime std.mem.eql(u8, fmt, "*")) { | 329 | if (comptime std.mem.eql(u8, fmt, "*")) { |
| 330 | try writer.writeAll(@typeName(@typeInfo(@TypeOf(value)).Pointer.child)); | 330 | try writer.writeAll(@typeName(std.meta.Child(@TypeOf(value)))); |
| 331 | try writer.writeAll("@"); | 331 | try writer.writeAll("@"); |
| 332 | try formatInt(@ptrToInt(value), 16, false, FormatOptions{}, writer); | 332 | try formatInt(@ptrToInt(value), 16, false, FormatOptions{}, writer); |
| 333 | return; | 333 | return; |
| ... | @@ -1246,6 +1246,10 @@ test "optional" { | ... | @@ -1246,6 +1246,10 @@ test "optional" { |
| 1246 | const value: ?i32 = null; | 1246 | const value: ?i32 = null; |
| 1247 | try testFmt("optional: null\n", "optional: {}\n", .{value}); | 1247 | try testFmt("optional: null\n", "optional: {}\n", .{value}); |
| 1248 | } | 1248 | } |
| | 1249 | { |
| | 1250 | const value = @intToPtr(?*i32, 0xf000d000); |
| | 1251 | try testFmt("optional: *i32@f000d000\n", "optional: {*}\n", .{value}); |
| | 1252 | } |
| 1249 | } | 1253 | } |
| 1250 | | 1254 | |
| 1251 | test "error" { | 1255 | test "error" { |