[Issue 19602] Under some circumstances: throwing Error subclasses unwinds without invoking dtors

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jan 22 11:47:54 UTC 2019


https://issues.dlang.org/show_bug.cgi?id=19602

--- Comment #10 from johanengelen at weka.io ---
Assuming it is intended behavior to not run dtors when an Error is thrown:
 The Error documentation says that "Certain runtime guarantees may fail to hold
when these errors are thrown, making it unsafe to continue execution after
catching them."  But why "after catching" ? What makes catching so special?
User code will still run in (some) dtors. I think what the text is saying is
that "Certain runtime guarantees may fail to hold when these errors are thrown,
making it unsafe to continue execution PERIOD." Perhaps a good solution is to
simply immediately abort execution upon throwing an Error.

--


More information about the Digitalmars-d-bugs mailing list