Making AssertError a singleton

Brad Roberts via Digitalmars-d digitalmars-d at puremagic.com
Mon Dec 12 13:35:44 PST 2016


On 12/12/16 12:59 PM, Andrei Alexandrescu via Digitalmars-d wrote:
> On 12/12/2016 11:35 AM, safety0ff wrote:
>> On Monday, 12 December 2016 at 15:51:07 UTC, Andrei Alexandrescu wrote:
>>>
>>> But of course there are many situations out there.
>>
>> Wouldn't it break chained assertion errors?
>
> Once a type in Error's cone gets thrown there is no guarantee of unwinding, hence no guarantee of
> chaining. -- Andrei

For this to have much meaning, at some-point druntime (for all the various compilers) is going to 
need to be changed to not unwind.  It does, and has all the effects that come from that.  What 
actually happens tends to trump what the documentation claims it's allowed to not do.  Of course, 
then you'll find the fun of all the tests (and probably code) that catch AssertError.



More information about the Digitalmars-d mailing list