RFC: Change what assert does on error

Timon Gehr timon.gehr at gmx.ch
Sun Jun 29 19:54:23 UTC 2025


On 6/29/25 20:04, Richard (Rikki) Andrew Cattermole wrote:
> 
> Should an assert fail, the most desirable behaviour for it to have is to 
> print a backtrace if possible and then immediately kill the process.
> 
> What a couple of us are suggesting is that we change the default 
> behaviour from ``throw AssertError``.
> To: ``printBacktrace; exit(-1);``

I don't want this, it's highly undesirable. I agree that silently 
killing only the single thread is terrible, but that's not something 
that affects me at the moment.

I guess you could kill the process instead of killing just the single 
thread, but breaking the stack unrolling outright is not something that 
is acceptable to me.


More information about the Digitalmars-d mailing list