www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18406] New: __traits( getOverloads ) doesn't accept module


          Issue ID: 18406
           Summary: __traits( getOverloads ) doesn't accept module symbols
                    as its aggregate parameter
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: critical
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: gooberman gmail.com

Created attachment 1680
  --> https://issues.dlang.org/attachment.cgi?id=1680&action=edit
Code example

From the documentation, "The first argument is an aggregate (e.g.
struct/class/module)." This gets further complicated when doing an allMembers pass of a module with an overloaded function - the function symbol will show up multiple times, but since you cannot get the overloads you can only resolve the first overload encountered by the compiler. Code example attached. Uses __traits( parent ) to get the module symbol. Other methods of obtaining the symbol, such as mixing in the name and assigning to an alias, result in the exact same error. Expected result: NumOverloads gets the value 2 assigned to it Actual result: Error message: expression expected as second argument of __traits getOverloads --
Feb 08 2018