From 6e45c4207fb2e1fc7fb2dbd3ecff28d2a3bfd92c Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Mon, 8 Jun 2026 14:48:50 -0700 Subject: [PATCH] fmt: make the 'format' compile error a bit more relaxed --- fmt.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fmt.zig b/fmt.zig index 4303ec19a11e9be9c828776821539671cb688bc2..5f96d03ddafbe69c603cf4f3fc54581d4bf3831a 100644 --- a/fmt.zig +++ b/fmt.zig @@ -424,7 +424,7 @@ fn formatType(value: anytype, comptime fmt: []const u8, options: FormatOptions, return formatAddress(value, options, writer); } - if (comptime std.meta.hasMethod(T, "format")) { + if (comptime std.meta.hasMethod(T, "format") and @typeInfo(@TypeOf(T.format)).@"fn".params[1].type.? != *std.Io.Writer) { @compileError("fix this: " ++ @typeName(T)); } if (std.meta.hasMethod(T, "nprint")) { -- 2.54.0