www.digitalmars.com         C & C++   DMDScript  

D - [BUG] reading/writing typedef array elements

[code]

typedef int[3] vec3;

void foo(vec3 r, vec3 v) {
    r[0] = v[0]; r[1] = v[1]; r[2] = v[2];
}

void main() {
    vec3[] x = new vec3[100];
    vec3 y;
//  printf("%d", x[0]); // if uncomment, produces "Internal error: 
..\ztc\cod1.c 2495"
//  foo(x[0], y); // if uncomment, produces "Internal error: ..\ztc\cod1.c 
2495"
//  x[0] = y; // if uncomment, produces "Internal error: ..\ztc\cod4.c 352"
}

But if replace typedef with alias, all works properly.
Apr 05 2004