On Thursday, 13 April 2017 at 05:29:28 UTC, Dukc wrote:
The reason it needs:

{   scope Object ob = new RefCountableType("foo");
    scope ob2 = ob;
    ob = new RefCountableType("bar");
}

The "foo" instance would leak if the destruction would be done by calling at end of scope.

I assume you mean if the compiler calls `delete ob` just before }. What I described would be implemented by the compiler deleting the original value of ob just before }.

Reply via email to