2015-06-10 15:55 GMT+09:00 Walter Bright via Digitalmars-d <digitalmars-d@puremagic.com>:
On 6/9/2015 10:39 PM, deadalnix wrote:
The actual code is far more complex than the presented sample :)

That what I'm trying to do in general, but here I'm faced with cases that are
very hard to untangle.

The 'tangle' of cyclical import graphs, as you so appropriately put, is not only hard on the compiler, it makes it much harder for human readers to make sense of code. Even reading your little code snippet hurts my brain.

Go, in one of their better decisions, decided "Thou Shalt Not Have Import Cycles". This forces users to untangle their code, and I believe that is A Good Thing.

I'd like to do that for D, but of course it is far too late for that.

D has true forward reference resolution mechanism. In that case modules are cyclic imported, but the declared symbols don't have actual cyclic references. Therefore the snippet should work.

https://github.com/D-Programming-Language/dmd/pull/4735

And the regression was introduced by your unrelated change. While fixing the issue, I couldn't understand why it was necessary.

https://github.com/D-Programming-Language/dmd/commit/a04cf864b932061ad7b72e7cad8b16fabc6a825a

Kenji Hara