www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - type inference by module

I'm having a tough time finding a workaround for not being able 
to reference adjacent types in a module 
(https://issues.dlang.org/show_bug.cgi?id=15726).   This is how I 
want to do it, but can't:

module x.y.z;

struct A(T) {
   alias B = .B!T;
}

struct B(T) {
   alias A = .B!T;
   alias C = .C!T;
}

struct C(T) {
   alias B = .B!T;
}

Higher layer code needs to be able to infer related types given a 
single type.   I also looked at creating a external template 
specialization, but it doesn't help because the type names are 
repeated across modules.   I thought there might be some way to 


A#B   // Refer to type B that is in same module as A

Any ideas on alternative ways to accomplish this?

erik
Feb 27 2016