On Sunday, 9 July 2017 at 02:57:54 UTC, Andrew Edwards wrote:


$ rdmd statmain.d stat1.d stat2.d
// outputs nothing...


Bug or intended behaviour?


rdmd takes the first D file you give it, follows its import tree, and compiles all the modules found there. Anything on the command line after the first source file is treated as a command line argument to the generated program. So stat1.d and stat2.d are never compiled. You'll see if you modify your main function to output the args that it will print the file names you passed.

To include stat1.d and stat2.d in the compilation, you'll either have to import them in statmain.d or use the --extra-file command line switch:

rdmd --extra-file=stat1.d --extra-file=stat2.d statmain.d

Reply via email to