Thread overview
[Issue 734] New: Multidimensional arrays use incorrect initializer
Dec 23, 2006
d-bugmail
Dec 26, 2006
Thomas Kuehne
Jan 04, 2007
d-bugmail
December 23, 2006
http://d.puremagic.com/issues/show_bug.cgi?id=734

           Summary: Multidimensional arrays use incorrect initializer
           Product: D
           Version: 0.177
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: wrong-code
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: dvdfrdmn@users.sf.net


------------------
typedef int Xint = 42;
void test1()
{
    Xint[3][] x = new Xint[3][4];
    foreach(Xint[3] i; x) {
        foreach (Xint j; i)
            assert(j == 42);
    }
}
void test2()
{
    Xint[3][] x = new Xint[3][4];
    x.length = 200;
    assert(x.length == 200);
    foreach(Xint[3] i; x) {
        foreach (Xint j; i)
            assert(j == 42);
    }
}
void main()
{
    test1();
    test2();
}
-----------------


-- 

December 26, 2006
d-bugmail@puremagic.com schrieb am 2006-12-23:
> http://d.puremagic.com/issues/show_bug.cgi?id=734

> ------------------
> typedef int Xint = 42;
> void test1()
> {
>     Xint[3][] x = new Xint[3][4];
>     foreach(Xint[3] i; x) {
>         foreach (Xint j; i)
>             assert(j == 42);
>     }
> }
> void test2()
> {
>     Xint[3][] x = new Xint[3][4];
>     x.length = 200;
>     assert(x.length == 200);
>     foreach(Xint[3] i; x) {
>         foreach (Xint j; i)
>             assert(j == 42);
>     }
> }
> void main()
> {
>     test1();
>     test2();
> }
> -----------------

Added to DStress as http://dstress.kuehne.cn/run/a/array_initialization_30_A.d http://dstress.kuehne.cn/run/a/array_initialization_30_B.d

Thomas


January 04, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=734


bugzilla@digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Comment #2 from bugzilla@digitalmars.com  2007-01-03 22:08 -------
Fixed DMD 1.00


--