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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri May 15 16:45:28 UTC 2020


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

--- Comment #6 from Basile-z <b2.temp at gmx.com> ---
To prevent a breaking change a 3rd trait parameter was added. When you add an
optional bool then templates are included, no matter the lexical order.

---
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", true).length == 2);
    static assert(__traits(getOverloads, Foo, "foo", true).length == 2);
}
---

There are still overloads bugs, but when alias are used
(https://issues.dlang.org/show_bug.cgi?id=20821). This is something else that
has to do with the fact that once the alias template parameters are missing the
lowering is difficual (declarations cant be lowered like expressions or
statements).

In case I'm wrong on the status of 16206 please provide a new test case that
justify the reopening.

--


More information about the Digitalmars-d-bugs mailing list