Comment #0 by dlang-bugzilla — 2020-12-19T10:24:13Z
If functions with the same name across several mixed-in mixin templates create an overload set, it is invisible to getOverloads:
///////////////////////// test.d /////////////////////////
struct A
{
void ov(int){}
void ov(string){}
}
struct B
{
mixin template M()
{
void ov(int){}
void ov(string){}
}
mixin M;
}
struct C
{
mixin template M(T)
{
void ov(T){}
}
mixin M!int;
mixin M!string;
}
pragma(msg, __traits(getOverloads, A, q{ov})); // OK
pragma(msg, __traits(getOverloads, B, q{ov})); // OK
pragma(msg, __traits(getOverloads, C, q{ov})); // nothing?
//////////////////////////////////////////////////////////
This is despite that the functions otherwise act like an overload set, i.e.:
C c; c.ov(1); c.ov("2");
works as expected.
Comment #1 by robert.schadek — 2024-12-13T19:13:31Z