[Issue 7564] New: Implicit conversion from static to dynamic array in loops

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Feb 22 15:24:45 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=7564

           Summary: Implicit conversion from static to dynamic array in
                    loops
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: sebastian.sandberg1000 at gmail.com


--- Comment #0 from Sebastian <sebastian.sandberg1000 at gmail.com> 2012-02-22 15:24:43 PST ---
import std.stdio;

void main()
{
    int[][] a;
    a.length = 3;

    for(int i; i<3; i++) {
      int[1] b;
      b[0] = i; 
      a[i] = b;
      writeln(a);
    }
}

Result:
[[0], [], []]
[[1], [1], []]
[[2], [2], [2]]

I expected the result:
[[0], [], []]
[[0], [1], []]
[[0], [1], [2]]

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list