opCast in class prevents destroy

Paul Backus snarwin at gmail.com
Tue Mar 1 17:55:07 UTC 2022

On Tuesday, 1 March 2022 at 16:40:50 UTC, Paul Backus wrote:
> It's a bug in druntime. `destroy` needs to reinterpret the 
> class reference as a `void*` to pass it to `rt_finalize`:
> https://github.com/dlang/druntime/blob/v2.098.1/src/object.d#L4209
> However, `cast(void*)` is not the correct way to do this, 
> because it fails in the presence of `opCast`.


More information about the Digitalmars-d-learn mailing list