www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 411] New: array alloc with size from another array

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=411

           Summary: array alloc with size from another array
           Product: D
           Version: 0.169
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: benoit tionex.de


void main(){
    int[]  ia;
    ia ~= 3;
    byte[] data = new byte[ia[0]]; // line 5
    byte[] data2 = new byte[ cast(int)(ia[s])]; // this compiles
}

a.d(5): need size of rightmost array, not type ia[0]


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

d-bugmail puremagic.com schrieb am 2006-10-09:
 http://d.puremagic.com/issues/show_bug.cgi?id=411

 void main(){
     int[]  ia;
     ia ~= 3;
     byte[] data = new byte[ia[0]]; // line 5
     byte[] data2 = new byte[ cast(int)(ia[s])]; // this compiles
 }

 a.d(5): need size of rightmost array, not type ia[0]

Added to DStress as http://dstress.kuehne.cn/run/a/array_initialization_28_A.d http://dstress.kuehne.cn/run/a/array_initialization_28_B.d http://dstress.kuehne.cn/run/a/array_initialization_28_C.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFFLlhBLK5blCcjpWoRAlQ5AJsEkjPUjsAlKXKtndnBpGIMXFA48gCghARl lOPJDR/hCDGqqkfR9vHjpeI= =9PWe -----END PGP SIGNATURE-----
Oct 12 2006
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=411


benoit tionex.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |godaves yahoo.com




------- Comment #2 from benoit tionex.de  2006-10-17 05:28 -------
*** Bug 439 has been marked as a duplicate of this bug. ***


-- 
Oct 17 2006
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=411


bugzilla digitalmars.com changed:

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




------- Comment #3 from bugzilla digitalmars.com  2006-10-18 13:25 -------
Fixed DMD 0.170


-- 
Oct 18 2006