www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 748] New: internal error with mixed static / dynamic array

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


-- 
Dec 25 2006
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=748


wbaxter gmail.com changed:

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





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.


-- 
Dec 26 2006
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=748


thomas-dloop kuehne.cn changed:

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





Added to DStress as
http://dstress.kuehne.cn/run/o/opCatAssign_21_A.d
http://dstress.kuehne.cn/run/o/opCatAssign_21_B.d


-- 
Jan 01 2007
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=748


bugzilla digitalmars.com changed:

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





Fixed DMD 1.00


-- 
Jan 03 2007