A Philosophy of Software Design
Richard (Rikki) Andrew Cattermole
richard at cattermole.co.nz
Sun May 24 06:49:28 UTC 2026
On 24/05/2026 4:10 PM, Walter Bright wrote:
> Invalid code nodes are replaced with "Error" nodes. This worked far
> better than I anticipated. No exceptions are thrown. It also behaves
> like NaN.
That's not actually how you handled it, although I'm sure it solved some
problems much more easily.
You handled it by checking the error count. In other words a global flag.
https://github.com/dlang/dmd/blob/3c2ad72ad3be9c38c76569ccd1574e39fec2256d/compiler/src/dmd/typesem.d#L4787
https://github.com/dlang/dmd/blob/3c2ad72ad3be9c38c76569ccd1574e39fec2256d/compiler/src/dmd/globals.d#L368
If you can get an error node without an error message that is an ICE
that should have been emitted but wasn't.
More information about the Digitalmars-d
mailing list