https://issues.dlang.org/show_bug.cgi?id=14331
Martin Nowak <c...@dawg.eu> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |c...@dawg.eu 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 <c...@dawg.eu> --- 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*. --