Module name conflicts with field

Chris Nicholson-Sauls ibisbasenji at gmail.com
Thu Oct 19 21:38:50 PDT 2006


Lionello Lunesu wrote:
> 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.

Interesting.  So, the global-scope operator fails on the current module's namespace, but 
succeeds on any other (thankfully).  Smells a little like a minor bug to me: it should be 
perfectly happy with the current module.

-- Chris Nicholson-Sauls



More information about the Digitalmars-d-learn mailing list