This crashes in the last line of main: class A { void foo() {} } void main() { A a = new A(); a.foo(); clear(a); assert(a !is null); a.foo(); // crashes } As far as I understand from TDPL book, this should not crash, but it does (DMD64 v2.062, OS X). Am I misunderstanding clear()? BTW, why not make clear also change 'a' to null?