traits allMembers and imported modules

cal callumenator at gmail.com
Mon Mar 11 15:54:55 PDT 2013


DMD 2.062:

//-- module other.d, same dir as main --
module other;
int j;
//--

//-- module dir/other.d, subdir of main --
module dir.other;
int j;
//--


//-- module main.d --
module main;

import other;
pragma(msg, [__traits(allMembers, (other))]);

import dir.other;
pragma(msg, [__traits(allMembers, dir.other)]);

void main(){}
//--

When the module name I use inside __traits is in the same dir as 
the main module, I need the extra parenthesis to satisfy the 
compiler. Is this a bug, or unavoidable?


More information about the Digitalmars-d-learn mailing list