On Thursday, 11 February 2016 at 04:07:18 UTC, cy wrote:

        A[] as = new A[2];
        assert(as.length==2);
        as[0].stuff = 42;

Oh, I get it. `as` is an array of 2 pointers to A objects, both pointers set to null. So I need to say like:

as[0..$] = new A();

before accessing .stuff on as[0].

Still no clue why it segfaulted on the allocation though, rather than the statement with the null dereference. Hidden optimization?

Reply via email to