std.fmt.Parser.peek() potential problem and fix therefore #20500
Labels
bug
Observed behavior contradicts documented or intended behavior
standard library
This issue involves writing Zig code for the standard library.
Milestone
Zig Version
0.14.0-dev.144+a31fe8aa3
Steps to Reproduce and Observed Behavior
Use a fresh project output by
zig init
and replacesrc/main.zig
with:When I try and compile this (with 0.12.0, 0.13.0, above cited 0.14.0 version), I get the following error:
You can see I'm using
ziege
, but that shouldn't matter, should it? I don't understand how this issue hasn't surfaced before, which makes me think it's a problem on my end. Then again, the code (see below) is the same in the repo as in myziege
managed installation. If you agree it's a generally applicable problem, fret not, the fix is trivial.Expected Behavior
The expectation is for this to compile (and work). We can track it down to the type information at
zig/lib/std/fmt.zig
Line 377 in 768b177
i
not acomptime_int
and the project compiles.Does a 7-byte change merit a PR?
I don't understand the logic behind it, though; observationally I can tell you that fixes "the" issue.
The text was updated successfully, but these errors were encountered: