mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00
16 lines
414 B
D
16 lines
414 B
D
// https://issues.dlang.org/show_bug.cgi?id=21743
|
|
|
|
struct A
|
|
{
|
|
int foo(int a) { return a; }
|
|
string foo()(string b) { return b; }
|
|
}
|
|
|
|
alias ov = __traits(getOverloads, A.init, "foo", true);
|
|
|
|
// member function works
|
|
static assert(ov[0](1) == 1);
|
|
|
|
// member template used to fail with the gagged error:
|
|
// 'need this for foo of type pure nothrow @nogc @safe string(string b)'
|
|
static assert(ov[1]("a") == "a");
|