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

--- Comment #19 from ag0ae...@gmail.com ---
(In reply to Andrei Alexandrescu from comment #16)
> The example in which the order of imports makes or breaks the build is
> compelling. Even better would be a bug whereby the project builds both ways
> but does different things. That would be the smoking gun.

My take on it:

foo.d:
----
version (A)
{
    static import baz;
    static import bar;
}
version (B)
{
    static import bar;
    static import baz;
}
void main()
{
    import std.stdio;
    writeln(bar.thing);
    writeln(baz.thing);
}
----

bar.d:
----
module baz;
enum thing = "this is baz from bar.d";
----

baz.d:
----
module bar;
enum thing = "this is bar from baz.d";
----

`dmd foo.d -version=A && ./foo`:
----
this is bar from baz.d
this is bar from baz.d
----

`dmd foo.d -version=B && ./foo`:
----
this is baz from bar.d
this is baz from bar.d
----

--

Reply via email to