| ... | ... | @@ -2434,6 +2434,7 @@ pub fn stringify( |
| 2434 | 2434 | |
| 2435 | 2435 | @compileError("Unable to stringify enum '" ++ @typeName(T) ++ "'"); |
| 2436 | 2436 | }, |
| 2437 | .ErrorSet => return out_stream.writeAll(@errorName(value)), |
| 2437 | 2438 | .Union => { |
| 2438 | 2439 | if (comptime std.meta.trait.hasFn("jsonStringify")(T)) { |
| 2439 | 2440 | return value.jsonStringify(options, out_stream); |
| ... | ... | @@ -2646,6 +2647,7 @@ test "stringify basic types" { |
| 2646 | 2647 | try teststringify("42", @as(u128, 42), StringifyOptions{}); |
| 2647 | 2648 | try teststringify("4.2e+01", @as(f32, 42), StringifyOptions{}); |
| 2648 | 2649 | try teststringify("4.2e+01", @as(f64, 42), StringifyOptions{}); |
| 2650 | try teststringify("ItBroke", @as(anyerror, error.ItBroke), StringifyOptions{}); |
| 2649 | 2651 | } |
| 2650 | 2652 | |
| 2651 | 2653 | test "stringify string" { |