Proposal 2: Exceptions and @nogc

Andrew Godfrey via Digitalmars-d digitalmars-d at puremagic.com
Sun Apr 9 19:04:35 PDT 2017


On Monday, 10 April 2017 at 01:54:54 UTC, Walter Bright wrote:
> On 4/9/2017 6:32 PM, Andrew Godfrey wrote:
>> Ok. So then if I have created a refcounted Exception, and 
>> later (in another
>> function) I take a reference to it (by stuffing it into a 
>> struct field, say),
>> how does that work?
>
> You can't, because the refcounted Exception will be marked with 
> 'scope' in the catch block.

In your proposal, you wrote:

> The only place a refcounted Throwable is ever created is when 
> the following statement is in the user code:

>    throw new E(string);

Did you mean to use the "scope" keyword somewhere in the line 
above?


More information about the Digitalmars-d mailing list