https://issues.dlang.org/show_bug.cgi?id=17288
Issue ID: 17288
Summary: formattedWrite error when width/precision provided and
no value to format
Product: D
Version: D2
Hardware: x86
OS: Windows
Status: NEW
Severity: minor
Priority: P1
Component: phobos
Assignee: [email protected]
Reporter: [email protected]
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.
--