| ... | @@ -2434,7 +2434,6 @@ pub fn stringify( | ... | @@ -2434,7 +2434,6 @@ pub fn stringify( |
| 2434 | | 2434 | |
| 2435 | @compileError("Unable to stringify enum '" ++ @typeName(T) ++ "'"); | 2435 | @compileError("Unable to stringify enum '" ++ @typeName(T) ++ "'"); |
| 2436 | }, | 2436 | }, |
| 2437 | .ErrorSet => return out_stream.writeAll(@errorName(value)), | | |
| 2438 | .Union => { | 2437 | .Union => { |
| 2439 | if (comptime std.meta.trait.hasFn("jsonStringify")(T)) { | 2438 | if (comptime std.meta.trait.hasFn("jsonStringify")(T)) { |
| 2440 | return value.jsonStringify(options, out_stream); | 2439 | return value.jsonStringify(options, out_stream); |
| ... | @@ -2493,6 +2492,7 @@ pub fn stringify( | ... | @@ -2493,6 +2492,7 @@ pub fn stringify( |
| 2493 | try out_stream.writeByte('}'); | 2492 | try out_stream.writeByte('}'); |
| 2494 | return; | 2493 | return; |
| 2495 | }, | 2494 | }, |
| | 2495 | .ErrorSet => return stringify(@as([]const u8, @errorName(value)), options, out_stream), |
| 2496 | .Pointer => |ptr_info| switch (ptr_info.size) { | 2496 | .Pointer => |ptr_info| switch (ptr_info.size) { |
| 2497 | .One => switch (@typeInfo(ptr_info.child)) { | 2497 | .One => switch (@typeInfo(ptr_info.child)) { |
| 2498 | .Array => { | 2498 | .Array => { |
| ... | @@ -2647,7 +2647,7 @@ test "stringify basic types" { | ... | @@ -2647,7 +2647,7 @@ test "stringify basic types" { |
| 2647 | try teststringify("42", @as(u128, 42), StringifyOptions{}); | 2647 | try teststringify("42", @as(u128, 42), StringifyOptions{}); |
| 2648 | try teststringify("4.2e+01", @as(f32, 42), StringifyOptions{}); | 2648 | try teststringify("4.2e+01", @as(f32, 42), StringifyOptions{}); |
| 2649 | try teststringify("4.2e+01", @as(f64, 42), StringifyOptions{}); | 2649 | try teststringify("4.2e+01", @as(f64, 42), StringifyOptions{}); |
| 2650 | try teststringify("ItBroke", @as(anyerror, error.ItBroke), StringifyOptions{}); | 2650 | try teststringify("\"ItBroke\"", @as(anyerror, error.ItBroke), StringifyOptions{}); |
| 2651 | } | 2651 | } |
| 2652 | | 2652 | |
| 2653 | test "stringify string" { | 2653 | test "stringify string" { |