DIP 1008 Preliminary Review Round 1

Martin Nowak via Digitalmars-d digitalmars-d at puremagic.com
Tue May 23 15:40:43 PDT 2017


On Friday, 19 May 2017 at 15:45:28 UTC, Mike Parker wrote:
> Extensive discussion of this DIP has already taken place in two 
> threads, both linked from the document. You may find it 
> beneficial to skim through those threads before posting any 
> feedback here.
>
> Thanks in advance to all who participate.
>
> Destroy!

The proposal is a very mechanical fix, throwing several special 
cases at one specific problem.
Why does it have to be refcounted? Seems like there is only ever 
one reference to the current exception (the catch variable).
The only thing that seems necessary is to require scope on catch 
variable declarations, so that people do not escape the class 
reference, then this info might be used by the runtime to free 
exception objects after the catch handler is done.

Amaury put a bit more words into that.
http://forum.dlang.org/post/gtqsojgqqaorubcsneie@forum.dlang.org

Has staticError been considered? It has a potential issue with 
multiple nested exceptions, but otherwise works fine.
https://github.com/dlang/druntime/blob/bc832b18430ce1c85bf2dded07bbcfe348ff0813/src/core/exception.d#L683


More information about the Digitalmars-d mailing list