"Error: Undefined identifier" when moving import to another module

nrgyzer via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Oct 20 10:37:33 PDT 2014


This solved the problem for the first time, BUT - I don't know if 
it's a bug or a feature - I ran into another problem. I'm having 
the following few lines:

module example;

private
{
    string[string] myPrivateArray;
}

static this()
{
    foreach ( m; __traits(allMembers, example) )
    {

       writefln("%s ::> %s", m, __traits(getProtection, m));
    }
}

void main() { /* empty */ }

Compiling and running the application say's that myPrivateArray 
is public:

myPrivateArray ::> public

I declared myPrivateArray using the private keyword, but the 
dmd-trait `getProtection` says public. Why?


More information about the Digitalmars-d-learn mailing list