PS. auto a = cast(const) new A(); doesn't compile eiither. Error is Error: cannot implicitly convert expression (cast(const A)new A) of type const A to test.A (test is the module name) Now that's bizarre. It won't compile because auto gets the type wrong!