On Tuesday, 27 January 2015 at 12:01:11 UTC, Fyodor Ustinov wrote:
On Tuesday, 27 January 2015 at 11:51:43 UTC, Vladimir Panteleev wrote:
In 2.067, this is an error:

test.d(4,9): Error: escaping reference to local variable buffer

Always or only in safe mode?

Always. But the check seems very simple, and is easily circumvented. This compiles:

byte[] func() {
 byte[1024] buffer;
 auto p = buffer[0..3];
 return p;
}

Reply via email to