Here is some code:
const std = @import("std");
pub fn main() void {
std.debug.print("Error: {!}", .{ error.TestError });
}
In 0.14 this prints:
Error: error.TestError
But in 0.15 I get a compiler error:
An error occurred:
/usr/local/bin/lib/std/Io/Writer.zig:1771:5: error: invalid format string '!' for type 'error{TestError}'
@compileError("invalid format string '" ++ fmt ++ "' for type '" ++ @typeName(@TypeOf(value)) ++ "'");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
referenced by:
printValue__anon_22746: /usr/local/bin/lib/std/Io/Writer.zig:1246:58
print__anon_22688: /usr/local/bin/lib/std/Io/Writer.zig:700:25
7 reference(s) hidden; use '-freference-trace=9' to see all references
Why? According to Zig Documentation {!} is still the correct way to format errors, right?