www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20884] New: Using getMember with a type as first argument can

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

          Issue ID: 20884
           Summary: Using getMember with a type as first argument can lose
                    type qualifiers.
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: boris2.9 gmail.com

code taken from bug 13343

struct S
{
  int x;
}

alias T = immutable(S);

pragma(msg, typeof(__traits(getMember, T, "x")).stringof);
pragma(msg, typeof(T.x).stringof);

Output:

  1>int
  1>immutable(int)

--
May 30 2020