On Monday, 6 July 2015 at 07:48:17 UTC, sigod wrote:
Aren't compiler smart enough to prevent it?

```
ubyte[] test1()
{
        auto b = sha1Of("");

        return b; // Error: escaping reference to local b
}

ubyte[] test2()
{
        return sha1Of(""); // works, but returns incorrect data
}
```

Looks more like a bug to me.

dmd 2.068.0 catches this. You can get the beta here:
http://downloads.dlang.org/pre-releases/2.x/2.068.0/

Reply via email to