I have this struct:

struct S
{
        int[] t;
        
        @disable this();
        
        this(int sz)
        {
                t = new int[sz];
                t[] = 1;
        }
        
        S opCall(int sz)
        {
                S s = S(sz);
                return s;
        }
        
        this(this)
        {
                t = t.dup;
        }
}


Naturally, this doesn't work:
S s; // compiler error

However this does compile.
S[100] s;


S[100] s;       
writeln(s[0].t[0]); // range violation error!

I think it's a bug, what do you think?

Reply via email to