www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - resizing static array in struct

The message produced by this code is rather cryptic:

/////////////////////////
struct A
{
    int [10] arr;   //line 3
}

void main ()
{
    A a;
    a.arr.length = 20;   //line 9
}

/////////////////////////

 dmd test.d
test.d(3): *(#a + 0).length is not an lvalue However the error is gone if line 9 is removed. The same happens if A is a union, but not if it's a class. ----------------------- Carlos Santander Bernal
Jul 25 2004