Making AssertError a singleton

Timon Gehr via Digitalmars-d digitalmars-d at puremagic.com
Mon Dec 12 13:40:25 PST 2016


On 12.12.2016 22:35, Brad Roberts via Digitalmars-d wrote:
> 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.
>

There is a /language feature/ ('in'-contract inheritance) that relies on 
normal execution after catching AssertError.


More information about the Digitalmars-d mailing list