Is this supposed to be allowed:

ubyte[] a;
ubyte[16] b;
a = b;
assert(a.ptr == b.ptr);

Because if so that makes it terribly easy to do a bug like this (as I just saw in IRC):

struct A
{
    ubyte[] a;
    this(ubyte c)
    {
        ubyte[16] b;
        b[] = c;
this.a = b; // a now points at an immediately invalid static array
    }
}

Reply via email to