Why does file order matters when using -run option?

Marc jckj33 at gmail.com
Wed Mar 14 14:44:24 UTC 2018


assume the files:

app.d

> void main() {
>   import myModule : foo;
>    writeln(foo(...));
>
> }

myModule.d

module myModule;
> int foo(int n) { .... }

the following fail:

> dmd -run app.d mymodule.d

give error like this:

> Error: module `myModule` is in file 'myModule.d' which cannot 
> be read

but this doesn't fail:

> dmd app.d mymodule.d && app

Why does -run fail here? I thought it was a shorthand to this 
batch:

> dmd app.d mymodule.d
> app.exe
> del app.exe



More information about the Digitalmars-d-learn mailing list