Arguably this is invalid code (depending on how one treats accessing unfinished declarations) and should be caught by the FE. But it is not caught, and, as the ICE happens in gdc-land, I'll report it here, JIC it's a symptom of a /real/ bug, and not only a UI issue. struct U { int a; mixin(`enum B { ` ~ U.tupleof[0].stringof ~ ` }`); mixin(`B b;`); } -> gdcbugicemix.d:1:0: internal compiler error: in layout_aggregate_type, at d/d-codegen.cc:4480 ^ 0x7631ef layout_aggregate_type(AggregateDeclaration*, tree_node*, AggregateDeclaration*) ../../gcc/d/d-codegen.cc:4480 0x78ad27 TypeVisitor::visit(TypeStruct*) ../../gcc/d/types.cc:262 0x78aa1d build_ctype(Type*) ../../gcc/d/types.cc:499 0x758252 AggregateDeclaration::toInitializer() ../../gcc/d/d-decls.cc:701 0x767a50 StructDeclaration::toObjFile() ../../gcc/d/d-objfile.cc:238 0x76a9d4 Module::genobjfile(bool) ../../gcc/d/d-objfile.cc:1424 0x756600 d_parse_file() ../../gcc/d/d-lang.cc:1211 Please submit a full bug report,
Looks like it's fixed in 2.068. Too which the merge is being dealt with.
This would be fixed as 2.068 is now in master.