It seems DMD syntactically allows the new operator nested class instantiation syntax together with the anonymous class syntax, like this: auto outer = new Outer(); outer.new class Inner { }; This syntax never makes sense, because an anonymous class instantiation always defines an outer context by itself (by means of the surrounding scope), so it cannot have another outer scope (ie, the outer class). Using this syntax will always result in a semantic error, or some compiler internal error. For example the following code compiles without semantic errors, but the linker fails: class Outer { int foo; auto x = new Outer().new class Inner {}; class Inner { } } void main() { }
It's a front end error nowadays. Error: class `temp_7FCDE39084D0.Outer` no size because of forward reference Although the error message might be better.