www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11079] New: Attributes for template functions should be visible when used with traits

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11079

           Summary: Attributes for template functions should be visible
                    when used with traits
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: andrej.mitrovich gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2013-09-20
14:36:56 PDT ---
-----
interface A
{
    static void foo(B obj)
    {
        // ok
        static assert(__traits(isStaticFunction,
            __traits(getMember, obj, "foo")));
    }

    static void bar(T)(T obj)
    {
        // fails
        static assert(__traits(isStaticFunction,
            __traits(getMember, obj, "bar")));
    }
}

class B : A
{
}

void main()
{
    B b = new B;
    b.foo(b);
    b.bar(b);
}

-----

I think this is the same symptom as in
http://d.puremagic.com/issues/show_bug.cgi?id=194, and particularly Walter's
comment http://d.puremagic.com/issues/show_bug.cgi?id=194#c1.

However, the templated function 'bar' is static regardless of what it's
instantiated with, so the traits should likely be able to work with it.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 20 2013
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11079



--- Comment #1 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2013-09-20
14:37:25 PDT ---
Issue was found by CounterPillow from IRC, filing on his behalf.

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