For -run the order matters which is very un-intuitive and violates DRY.
---
cat << EOF > test.d
import std.stdio;
void main()
{
writeln("Hello D", __FILE__);
import bar;
foo();
}
EOF
cat << EOF > bar.d
void foo(){}
EOF
----
> dmd -run test.d bar.d
test.o:test.d:function _Dmain: error: undefined reference to '_D3bar3fooFZv'
collect2: error: ld returned 1 exit status
Error: linker exited with status 1
> dmd bar.d -run test.d
Hello Dtest.d
See also: https://issues.dlang.org/show_bug.cgi?id=18476
Comment #1 by timothee.cour2 — 2018-02-20T19:26:18Z
or using har syntax (https://github.com/marler8997/har):
```har
--- test.d
import std.stdio;
void main()
{
writeln("Hello D", __FILE__);
import bar;
foo();
}
--- bar.d
void foo(){}
```
another issue is -run disallows things like:
`dmd **/*.d -run`
and leads to complex workarounds