www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19068] New: __traits(identifier) returns the wrong string

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

          Issue ID: 19068
           Summary: __traits(identifier) returns the wrong string when
                    importing a template from a module
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: atila.neves gmail.com

/// mod.d
auto identity(T)(T t) { return t; }
///


/// main.d
import mod;
alias identityInt = identity!int;
enum memberName = __traits(identifier, __traits(getMember, main,
"identityInt"));
static assert(memberName == "identityInt",
              "Expected 'identityInt', got '" ~ memberName ~ "'");
///


The static assert fails, with __traits(identifier) returning "identity" instead
of "identityInt".

--
Jul 06 2018