www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19589] New: Impossible to determine if a symbol returned by

https://issues.dlang.org/show_bug.cgi?id=19589

          Issue ID: 19589
           Summary: Impossible to determine if a symbol returned by
                    __traits(allMembers) is a module, or package.
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: default_357-line yahoo.de

When a module is imported, it will show up in __traits(allMembers, <containing
scope>) as a member, but there is no way to determine that it is a module (or
package) other than inspecting its stringof.

import std.stdio;

pragma(msg, std.stdio.stringof); returns "module stdio".

A possible solution would be traits `isModule` and `isPackage`.

--
Jan 15 2019