a.d:1:8: internal compiler error: in visit, at d/imports.cc:46 import b; ^ 0x7f3f33 ImportVisitor::visit(Dsymbol*) ../../dev/gcc/d/imports.cc:46 0x61de17 Visitor::visit(ScopeDsymbol*) ../../dev/gcc/d/dfrontend/visitor.h:402 0x61e01f Visitor::visit(AggregateDeclaration*) ../../dev/gcc/d/dfrontend/visitor.h:413 0x61e053 Visitor::visit(StructDeclaration*) ../../dev/gcc/d/dfrontend/visitor.h:414 0x76c9e3 StructDeclaration::accept(Visitor*) ../../dev/gcc/d/dfrontend/aggregate.h:196 0x7f4125 ImportVisitor::visit(AliasDeclaration*) ../../dev/gcc/d/imports.cc:81 0x7f3ebb build_import_decl(Dsymbol*) ../../dev/gcc/d/imports.cc:148 0x7b5069 Dsymbol::toObjFile() ../../dev/gcc/d/d-objfile.cc:138 0x7b9c1b Module::genobjfile(bool) ../../dev/gcc/d/d-objfile.cc:1461 0x7945eb d_parse_file() ../../dev/gcc/d/d-lang.cc:1244 --- Reduced test: a.d: --- import b; import c : S; --- b.d --- import a; S* s; --- c.d --- struct S { } ---
This happens because AggregateDeclaration inherits from ScopeDsymbol, not Declaration.
https://github.com/D-Programming-GDC/GDC/pull/242