About Go, D module naming

Andrej Mitrovic andrej.mitrovich at gmail.com
Fri Dec 21 06:52:14 PST 2012


On 12/21/12, Walter Bright <newshound2 at digitalmars.com> wrote:
> snip

Walter, can you verify if this is or isn't a bug:

.\main.d
.\foo.d

main.d:

module main;
import foo;
void main() { test(); }

foo.d:

module bar;
void test() { }

This is OK:

$ dmd -c main.d foo.d
> main.d(2): Error: module bar from file foo.d must be imported as
 module 'bar'

But this is questionable:
$ dmd -c main.d
> // no complaints

It seems the compiler doesn't complain about invalid import statements
when it tries to find the module via its import path. Bug?


More information about the Digitalmars-d mailing list