| ... | ... | @@ -316,7 +316,7 @@ pub fn formatType( |
| 316 | 316 | options: FormatOptions, |
| 317 | 317 | out_stream: var, |
| 318 | 318 | max_depth: usize, |
| 319 | | ) !void { |
| 319 | ) @TypeOf(out_stream).Error!void { |
| 320 | 320 | if (comptime std.mem.eql(u8, fmt, "*")) { |
| 321 | 321 | try out_stream.writeAll(@typeName(@TypeOf(value).Child)); |
| 322 | 322 | try out_stream.writeAll("@"); |
| ... | ... | @@ -1472,19 +1472,19 @@ test "enum" { |
| 1472 | 1472 | try testFmt("E.Two", "{}", .{inst}); |
| 1473 | 1473 | } |
| 1474 | 1474 | |
| 1475 | | // test "struct.self-referential" { |
| 1476 | | // const S = struct { |
| 1477 | | // const SelfType = @This(); |
| 1478 | | // a: ?*SelfType, |
| 1479 | | // }; |
| 1475 | test "struct.self-referential" { |
| 1476 | const S = struct { |
| 1477 | const SelfType = @This(); |
| 1478 | a: ?*SelfType, |
| 1479 | }; |
| 1480 | 1480 | |
| 1481 | | // var inst = S{ |
| 1482 | | // .a = null, |
| 1483 | | // }; |
| 1484 | | // inst.a = &inst; |
| 1481 | var inst = S{ |
| 1482 | .a = null, |
| 1483 | }; |
| 1484 | inst.a = &inst; |
| 1485 | 1485 | |
| 1486 | | // try testFmt("S{ .a = S{ .a = S{ .a = S{ ... } } } }", "{}", .{inst}); |
| 1487 | | // } |
| 1486 | try testFmt("S{ .a = S{ .a = S{ .a = S{ ... } } } }", "{}", .{inst}); |
| 1487 | } |
| 1488 | 1488 | |
| 1489 | 1489 | test "struct.zero-size" { |
| 1490 | 1490 | const A = struct { |