I'm glad throw is now an expression

max haughton maxhaton at gmail.com
Tue May 17 20:57:09 UTC 2022


On Tuesday, 17 May 2022 at 20:06:35 UTC, kdevel wrote:
> Is this reproducible
Yes, it is.

This is an assertion in the backend (Walter you need to fix these 
they are blocking work on noreturn).

```
dmd: src/dmd/backend/cod4.d:424: Assertion `cast(int)sz > 0' 
failed.
```

However this is a bug with the implementation of noreturn rather 
than throw expressions.
The PR I just raised only adjusts the tables that govern implicit 
conversions to be more aware of noreturn.

I haven't look into this in any detail but the assertion 
triggering here is probably because the frontend is casting the 
noreturn-ing expression to an int. This be a hack to make the 
backend work with noreturn however I'm not familiar with the 
foundation of it's implementation.


More information about the Digitalmars-d mailing list