What should happen when the assert message expression throws?

JG someone at somewhere.com
Sat Nov 19 07:14:22 UTC 2022


On Friday, 18 November 2022 at 12:36:14 UTC, RazvanN wrote:
> I have stumbled upon: 
> https://issues.dlang.org/show_bug.cgi?id=17226
>
> [...]


What about rewriting
```d
assert(false,format("oops",1));
```
to
```d

     assert(false,(){
         try {
         return format("oops",1);
         }
         catch(Exception e)
         {
             //throw equivalent error (this should be improved)
             throw new Error(e.msg);
         }
     }());
```


More information about the Digitalmars-d mailing list