D-Programming-Language/dmd — pull request #3545 by 9rnsr (2014-05-12 16:31:35+00:00)
Title: [REG2.066a] Issue 12727 - DMD hangs up on recursive alias declaration

https://issues.dlang.org/show_bug.cgi?id=12727

By the commit fd1762c33ac034ad3112e69f21421b5c75b3cc6c, now static-if declaration does nothing in `addMembers` phase, and conditional eponymous template instance cannot raise "recursive alias declaration" error in `TemplateInstance::semantic`, because `TemplateInstance::aliasdecl` is not set until the end of it.

By looking for circular aliasing not only in `AliasDeclaration::semantic` but also in `AliasDeclaration::toAlias`, we can defer the detection until appropriate timing.