Thread overview
[Issue 411] New: array alloc with size from another array
Oct 09, 2006
d-bugmail
Oct 12, 2006
Thomas Kuehne
Oct 17, 2006
d-bugmail
Oct 18, 2006
d-bugmail
October 09, 2006
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]


-- 

October 12, 2006
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


October 17, 2006
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. ***


-- 

October 18, 2006
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


--