Bug 7877 – std.string.format does not support positional arguments

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-04-09T10:36:00Z
Last change time
2012-04-09T13:54:23Z
Assigned to
nobody
Creator
andrej.mitrovich

Comments

Comment #0 by andrej.mitrovich — 2012-04-09T10:36:29Z
import std.string; import std.stdio; void main() { // ok writefln("%1$s %2$s", 2, 1); // std.format.FormatException@std\format.d(4562): formatArg string s = format("%1$s %2$s", 2, 1); }
Comment #1 by bearophile_hugs — 2012-04-09T11:01:31Z
That code gives me this output: 2 1 std.format.FormatException@std\format.d(4906): formatArg ---------------- ---------------- Such error messages must be improved, they are essentially like the error messages without line number (that Don regards of very high importance in Bugzilla). How do you find errors in a large program with no line number and no usable stack trace? Maybe if not already present this needs to become another Bugzilla entry.
Comment #2 by smjg — 2012-04-09T13:54:23Z
*** This issue has been marked as a duplicate of issue 4532 ***