https://issues.dlang.org/show_bug.cgi?id=14331
Martin Nowak <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] Summary|Can't call `destroy()` on a |Cannot cast(void*) a class |class with `alias this` on |with an alias this struct |a struct field | --- Comment #1 from Martin Nowak <[email protected]> --- cat > bug.d << CODE class Test { static struct S {} S s; alias s this; } void main() { auto p = cast(void*)(new Test); } CODE dmd -c bug ---- bug2.d(11): Error: cannot cast expression (new Test).s of type S to void* ---- It is a more general problem that you cannot cast the class to void*. --
