Steps to reproduce: 1) Create a.d and b.d with the following contents a.d: ---------------------------------------- struct Alpha(uint _) { import a; } struct Foxtrot(uint _) { alias Attributes = Alpha!10; enum A = 10; } ---------------------------------------- b.d: ---------------------------------------- import a; alias Charlie = Foxtrot!(0); ---------------------------------------- 2) Run the compiler. `dmd a.d b.d` I've been able to reproduce this issue with several front-end versions. It is present in 2.088.1-beta.1 as well.
I think that a module importing itself should be an error.
@RazvanN7 created dlang/dmd pull request #10465 "Fix Issue 20280 - Compiler segfault when building two small files" fixing this issue: - Fix Issue 20280 - Compiler segfault when building two small files https://github.com/dlang/dmd/pull/10465
dlang/dmd pull request #10465 "Fix Issue 20280 - Compiler segfault when building two small files" was merged into stable: - 4e373d704bfdb7d1d18fb6bd1c7365f96fc9831a by RazvanN7: Fix Issue 20280 - Compiler segfault when building two small files https://github.com/dlang/dmd/pull/10465
dlang/dmd pull request #12339 "[dmd-cxx] Backport fixes and trivial features from upstream dmd" was merged into dmd-cxx: - 44a3dc29fc40fbf2c7a209db32c1ccba6239e92c by RazvanN7: [dmd-cxx] Fix Issue 20280 - Compiler segfault when building two small files https://github.com/dlang/dmd/pull/12339