]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gdc.test/compilable/test21743.d
d: Import dmd b8384668f, druntime e6caaab9, phobos 5ab9ad256 (v2.098.0-beta.1)
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / compilable / test21743.d
1 // https://issues.dlang.org/show_bug.cgi?id=21743
2
3 struct A
4 {
5 int foo(int a) { return a; }
6 string foo()(string b) { return b; }
7 }
8
9 alias ov = __traits(getOverloads, A.init, "foo", true);
10
11 // member function works
12 static assert(ov[0](1) == 1);
13
14 // member template used to fail with the gagged error:
15 // 'need this for foo of type pure nothrow @nogc @safe string(string b)'
16 static assert(ov[1]("a") == "a");