How do I defeat the gratuitous qualification of alias members?

Tobias Pankrath tobias at pankrath.net
Thu Apr 4 23:50:34 PDT 2013


On Friday, 5 April 2013 at 06:20:05 UTC, Chad Joan wrote:

> I still can't escape the feeling that this is a hack to work 
> around limitations of the language or lack of knowledge.

The only hack around a language limitation I see in this thread 
is the use of prefixes to distinguish between different enums.

Your comparison between enum and modules is misplaced. It's 
better to compare enums with structs and classes.

---
module A;

struct Foo {
     enum name = "foo";
}
--
module B;
import A;

void main() { writeln(name); } // don't think that should work
---

And it shouldn't work for enums, too. Imports should only pull 
top level names into a scope.




More information about the Digitalmars-d-learn mailing list