About Go, D module naming

mist nvm at none.none
Fri Dec 21 07:09:14 PST 2012


I remember having very weird issues with rdmd when module is 
called "main". May be this one is similar?

On Friday, 21 December 2012 at 14:52:27 UTC, Andrej Mitrovic 
wrote:
> 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