On Wed, Oct 08, 2014 at 06:39:26PM +0000, Diffuse via Digitalmars-d-learn wrote:
> Everything works fine. But things also compile if I declare
> file2's module to be "module candyfloss" while still importing
> "file2" within main.d

You should always import the same thing as the module, but you also
need to pass the file to the compiler explicitly so it can find it.

dmd main.d file2.d

would work if you did import candyfloss; and module candyfloss;


In general, I recommend always passing all files to the compiler explicitly
so it can build an accurate file to module mapping and link all code in.

Reply via email to