[dmd-internals] Throwing Errors

Jonathan M Davis jmdavisProg at gmx.com
Mon Mar 12 17:16:28 PDT 2012


On Monday, March 12, 2012 22:34:25 Don Clugston wrote:
> Well I've never heard that before, and I wrote the code on Windows to
> make sure that they do get executed.
> It's not an accident that it works.

I believe that Walter (and maybe Andrei?) has said it before - which is where 
I heard it from - but I haven't been able to find any posts confirming that, and 
none of the documentation says it as far as I can tell - which is why I 
started this thread to verify it. So, it really doesn't seem unreasonable for 
people to expect that all Throwables function the same with regards to scope 
statements, destructors, and finally blocks. If we really want them to act 
differently, we need to say so clearly. The intended design is definitely _not_
being gotten across clearly at this point.

There are advantages to having Errors skip cleanup, but there are definite 
disadvantages too, and particularly given that they _don't_ currently skip 
cleanup, I'm increasingly inclined to say that we should just guarantee that 
they're guaranteed to do the cleanup just like normal Exceptions are.

- Jonathan M Davis


More information about the dmd-internals mailing list