www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - ice returning a delegate

//-----------------------
T delegate (T) acc (T) (T n)
{
         return (T i) { return n += i; };
}

void foo ()
{
         auto acc1 = acc (4);
}
//-----------------------

$ gdmd test
../../gcc-4.0.2/gcc/d/dmd/mtype.c:2294: failed assertion `next'
test.d:0: internal compiler error: Abort trap

Tested with gdc 0.18 (sf rev 9), based on dmd 0.161.

-- 
Carlos Santander Bernal
Jun 22 2006