[Issue 10080] New: Attributes lost when passing value to a templated function

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue May 14 00:34:38 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10080

           Summary: Attributes lost when passing value to a templated
                    function
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: simendsjo at gmail.com


--- Comment #0 from simendsjo <simendsjo at gmail.com> 2013-05-14 00:34:37 PDT ---
Using dmd 2.062 on GNU/Linux, this prints:
  main: tuple(1)
  f: tuple()
  g: tuple(1)

void f(T)(T o) {
    pragma(msg, "f: ", __traits(getAttributes, o));
}

void g(alias T)() {
    pragma(msg, "g: ", __traits(getAttributes, T));
}

void main() {
    @(1) int i;
    pragma(msg, "main: ", __traits(getAttributes, i));
    f(i);
    g!i;
}

Is this intended behavior?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list