| 1 |
/* |
| 2 |
TEST_OUTPUT: |
| 3 |
--- |
| 4 |
fail_compilation/onemember_overloads.d(29): Error: none of the overloads of `skipOver` are callable using argument types `()` |
| 5 |
fail_compilation/onemember_overloads.d(25): Candidates are: `onemember_overloads.skipOver(string)` |
| 6 |
fail_compilation/onemember_overloads.d(18): `skipOver(alias pred = (a, b) => a == b)` |
| 7 |
fail_compilation/onemember_overloads.d(20): - Containing: `skipOver(Haystack, Needles...)(ref Haystack haystack, Needles needles)` |
| 8 |
fail_compilation/onemember_overloads.d(21): - Containing: `skipOver(R)(ref R r1)` |
| 9 |
fail_compilation/onemember_overloads.d(22): - Containing: `skipOver(R, Es...)(ref R r, Es es)` |
| 10 |
fail_compilation/onemember_overloads.d(30): Error: template `t2` is not callable using argument types `!()()` |
| 11 |
fail_compilation/onemember_overloads.d(33): Candidate is: `t2(T)` |
| 12 |
fail_compilation/onemember_overloads.d(35): - Containing: `t2(string)` |
| 13 |
fail_compilation/onemember_overloads.d(36): - Containing: `t2(int[])` |
| 14 |
fail_compilation/onemember_overloads.d(37): - Containing: `t2(R)(R)` |
| 15 |
--- |
| 16 |
*/ |
| 17 |
|
| 18 |
template skipOver(alias pred = (a, b) => a == b) |
| 19 |
{ |
| 20 |
bool skipOver(Haystack, Needles...)(ref Haystack haystack, Needles needles) => true; |
| 21 |
bool skipOver(R)(ref R r1) => true; |
| 22 |
bool skipOver(R, Es...)(ref R r, Es es) => true; |
| 23 |
} |
| 24 |
|
| 25 |
void skipOver(string); |
| 26 |
|
| 27 |
void main() |
| 28 |
{ |
| 29 |
skipOver(); |
| 30 |
t2(); |
| 31 |
} |
| 32 |
|
| 33 |
template t2(T) |
| 34 |
{ |
| 35 |
bool t2(string); |
| 36 |
bool t2(int[]); |
| 37 |
bool t2(R)(R); |
| 38 |
} |