Bug 137 – std.format.doFormat doesn't like arrays of static arrays
Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P2
Component
phobos
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2006-05-12T13:12:00Z
Last change time
2014-02-15T13:29:07Z
Assigned to
bugzilla
Creator
matti.niemenmaa+dbugzilla
Comments
Comment #0 by matti.niemenmaa+dbugzilla — 2006-05-12T13:12:42Z
private import std.stdio;
void main() {
const int[ ][] foo = [[1, 3], [2, 4]];
const int[2][] bar = [[1, 3], [2, 4]];
writefln(foo);
writefln(bar);
}
--
The first call to writefln outputs "[[1,3],[2,4]]", the second "[Error: std.format formatArg".
Given that outputting plain static arrays works fine, there doesn't seem to be a good reason why this shouldn't.
Of course, this is easy to work around, for instance by outputting each static array separately in a foreach loop.
Comment #1 by davidl — 2007-01-23T05:11:53Z
the second now AV
Comment #2 by matti.niemenmaa+dbugzilla — 2007-04-21T10:49:07Z