On 10/14/16 4:49 PM, Nick Sabalausky wrote:
This compiles. Is it supposed to?

@safe ubyte[] foo()
    ubyte[512] buf;
    auto slice = buf[0..$];
    // Escaping reference to stack memory, right?
    return slice;

Yes, this still is a problem, but Walter has a fix in the works.


This one is also fun:

ubyte[512] foo();

ubyte[] x = foo(); // compiles, but never is correct. Ever.



Reply via email to