[Issue 16206] New: traits getOverloads fails when one of the overload is a templatized function

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Jun 26 08:06:08 PDT 2016


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

          Issue ID: 16206
           Summary: traits getOverloads fails when one of the overload is
                    a templatized function
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: b2.temp at gmx.com

And the declaration order matters:

struct Foo
{
    void foo(A,Z)(A a, Z z){}
    void foo(float v){}
}

struct Bar
{
    void bar(float v){}
    void bar(A,Z)(A a, Z z){}
}

void main()
{
    static assert(__traits(getOverloads, Bar, "bar").length > 0); // OK
    static assert(__traits(getOverloads, Foo, "foo").length > 0); // FAILS
}

making introspection imprevisible.

--


More information about the Digitalmars-d-bugs mailing list