Module name conflicts with field

Lionello Lunesu lio at lunesu.remove.com
Mon Oct 16 08:05:13 PDT 2006


Jarrett Billingsley wrote:
> Strangely, what I thought would work, doesn't:
> 
> struct A {}
> struct B
> {
>     .test.A a;
>     int test;
> }

Actually, that's exactly how I managed to fix it! Apparently it doesn't 
work in the simplified test case, but when using two files (as in my 
project) the leading dot fixes the problem:

[test.d]
struct A {}

[main.d]
import test;
struct B {
   .test.A a;
   int test;
}

I agree that there won't be many people with this problem, but I would 
expect types and field names / variables to be in separate name lookup 
lists.

L.



More information about the Digitalmars-d-learn mailing list