Cannot import module that has name of a package
Hennrich Blöbaum
hennrich.bloebaum at gmx.de
Thu Mar 22 10:51:27 PDT 2007
Frits van Bommel schrieb:
> Hennrich Blöbaum wrote:
>> Hi!
>>
>> Look at this:
>>
> [snip]
>>
>> This gives error:
>> test/foo.d: module test.foo module and package have the same name
>>
>>
>> Is there any reason why this is blocked?
>
> > <test/foo.d>
> > module test.foo;
>
> class bar {
> static void baz() {
> // ... Some function implementation ...
> }
> }
>
> > <test/foo/bar.d>
> > module test.foo.bar;
>
> void baz() {
> // ... Some completely different function implementation ...
> }
>
> > <main.d>
> > import test.foo;
> > import test.foo.bar;
>
> void main() {
> test.foo.bar.baz(); // which function does this call?
> }
oh yeah... ;)
thanks
More information about the Digitalmars-d
mailing list