Bug 17288 – formattedWrite error when width/precision provided and no value to format
Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2017-03-30T16:43:31Z
Last change time
2018-01-05T13:28:03Z
Assigned to
No Owner
Creator
Nick Treleaven
Comments
Comment #0 by nick — 2017-03-30T16:43:31Z
The following calls have a missing integer, the first is used for precision (same happens for %*.d width too):
import std.format;
unittest
{
enum f = format("%.*d", 5); // Compile error: "n = 1"
auto s = format("%.*d", 5); // throws RangeError
}
Instead, format should throw FormatError. PR to follow.
Comment #1 by github-bugzilla — 2017-04-03T17:17:01Z