www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 734] New: Multidimensional arrays use incorrect initializer

reply d-bugmail puremagic.com writes:
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();
}
-----------------


-- 
Dec 23 2006
next sibling parent Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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 -----BEGIN PGP SIGNATURE----- iD8DBQFFkP+cLK5blCcjpWoRAsYwAKCGJPvWAO4U0WG+PLNpUkhRP3Z8VQCfaH3k bPUunaB4/pmvllZcXnFv42g= =bpRX -----END PGP SIGNATURE-----
Dec 26 2006
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=734


bugzilla digitalmars.com changed:

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





Fixed DMD 1.00


-- 
Jan 03 2007