www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 720] New: bug in array literal parsing with append

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

           Summary: bug in array literal parsing with append
           Product: D
           Version: 0.177
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: kevinbealer gmail.com


The following code causes an assert in dmd -- it seems to have to do with
deducing the type of an array literal.  If I assign the array literal to
a variable, then append that to the array, it works.

The error:

dmd -ofmini mini.d
Internal error: ../ztc/cod1.c 2526 

The code:

-----
void foo()
{
    int[2][] pos;
    pos ~= [1, 2];
}

int main(char[][] a)
{
    foo();
    return 0;
}
-----

Kevin


-- 
Dec 22 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-22:
 http://d.puremagic.com/issues/show_bug.cgi?id=720

 The following code causes an assert in dmd -- it seems to have to do with
 deducing the type of an array literal.  If I assign the array literal to
 a variable, then append that to the array, it works.

 The error:

 dmd -ofmini mini.d
 Internal error: ../ztc/cod1.c 2526 

 The code:

 -----
 void foo()
 {
     int[2][] pos;
     pos ~= [1, 2];
 }

 int main(char[][] a)
 {
     foo();
     return 0;
 }
 -----

Added to DStress as http://dstress.kuehne.cn/run/o/opCatAssign_20_A.d http://dstress.kuehne.cn/run/o/opCatAssign_20_B.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFFkRKJLK5blCcjpWoRAuHpAJsGPV16dUaya0KR8bOFGSlmAzU2CACgmvpx kKxDyMCl6dr6DyXguyCb7fg= =wdM5 -----END PGP SIGNATURE-----
Dec 26 2006
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=720


thomas-dloop kuehne.cn changed:

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




------- Comment #2 from thomas-dloop kuehne.cn  2007-04-27 12:32 -------
Fixed since DMD-1.00


-- 
Apr 27 2007