Thread overview
[Issue 748] New: internal error with mixed static / dynamic array
Dec 26, 2006
d-bugmail
Dec 26, 2006
d-bugmail
Jan 01, 2007
d-bugmail
Jan 04, 2007
d-bugmail
December 26, 2006
http://d.puremagic.com/issues/show_bug.cgi?id=748

           Summary: internal error with mixed static / dynamic array
           Product: D
           Version: 0.178
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: ice-on-invalid-code
          Severity: minor
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: wbaxter@gmail.com


This code is incorrect but it shouldn't cause an internal compiler error.

void main()
{
    int[2][] a;
    a ~= [1,2];
    // should be  a ~= [[1,2]];
}

I get: Internal error: ..\ztc\cod1.c 2526


-- 

December 26, 2006
http://d.puremagic.com/issues/show_bug.cgi?id=748


wbaxter@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|minor                       |normal
           Keywords|                            |spec




------- Comment #1 from wbaxter@gmail.com  2006-12-26 11:53 -------
On second thought, maybe that should compile.  Generally speaking this works:

T[] a;
T b;
a ~= b

For instance it's no problem if T is int,float, or any struct, etc.  In this case T happens to be int[2], and it crashes the compiler.

Anyway, this (concatenating single elements with arrays) is one point on which the spec is notably silent.  If the above is not supposed to work, then it is an error for it to work in the case of int, float et al.   If it is supposed to work, then it is an error for it not to work for int[2].

Either way the spec should probably be explicit about whether the above is legal.


-- 

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


thomas-dloop@kuehne.cn changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         OS/Version|Windows                     |All




------- Comment #2 from thomas-dloop@kuehne.cn  2007-01-01 10:35 -------
Added to DStress as http://dstress.kuehne.cn/run/o/opCatAssign_21_A.d http://dstress.kuehne.cn/run/o/opCatAssign_21_B.d


-- 

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


bugzilla@digitalmars.com changed:

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




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


--