[RFC] Throwing an exception with null pointers

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Wed Apr 16 17:08:41 UTC 2025


On 17/04/2025 4:55 AM, Walter Bright wrote:
> On 4/12/2025 4:11 PM, Richard (Rikki) Andrew Cattermole wrote:
>> The .net exceptions are split into managed and unmanaged exceptions.
> 
> Sounds equivalent to D's Exception and Error hierarchies.

Its not.

The unmanaged exceptions are from native, then it gets wrapped by .net 
so it can be caught. Including for null dereference.

As far as I'm aware cleanup routines are not messed with.

We've lately been discussing what to do with Error on Discord, and so 
far it seems like the discussion is going in the direction of it should 
either do what assert does and kill the process with a function pointer 
in the middle to allow configurability, or throw what I've dubbed a 
framework exception.

A framework exception sits in the middle of the existing hierarchy, does 
cleanup, but doesn't effect nothrow.

Manu wanted something like this recently for identical reasons that me 
and Adam do.



More information about the Digitalmars-d mailing list