Comment #0 by shammah.chancellor — 2013-11-24T12:33:52Z
I have:
module messages;
public import messages.chat;
public import messages.auth;
public import messages.channel;
public import messages.core;
from messages.core.d:
pragma(msg, __traits(allMembers, messages);
prints:
tuple("object", "std", "vibe", "client", "user", "channels", "messages", "ChatMessage", "PrivateMessage")
prints the standard D objects for that package.d, but also the items in messages.auth, but NOTHING from the other public imports. I would not expect it to print anything but the D objects and the modulename's for the modules being imported.
It doesn't seem to be possible to reflect on modules, and then on elements in modules at the current time as there is also no way to get an identifier back for a package from it's string returned from allMembers.
A more minimal test case:
---
module main;
import core.thread;
//Broken:
pragma(msg, __traits(allMembers, core));
//Seems to work:
pragma(msg, __traits(allMembers, core.thread));
void main() {}
---
The interesting thing is that the issue only seems to surface for root packages. In the backend source, when working with __traits (see traits.d), most package symbols have been resolved to Package objects, but root package names haven't been fully resolved; they're still Import objects. That's probably related to this issue.