[Bug 137] New: std.format.doFormat doesn't like arrays of static arrays

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri May 12 11:12:43 PDT 2006


http://d.puremagic.com/bugzilla/show_bug.cgi?id=137

           Summary: std.format.doFormat doesn't like arrays of static arrays
           Product: D
           Version: 0.157
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: minor
          Priority: P3
         Component: Phobos
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: deewiant at gmail.com


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.


-- 




More information about the Digitalmars-d-bugs mailing list