| 1 |
// https://issues.dlang.org/show_bug.cgi?id=21025 |
| 2 |
// REQUIRED_ARGS: -preview=dip1021 |
| 3 |
|
| 4 |
/* |
| 5 |
TEST_OUTPUT: |
| 6 |
--- |
| 7 |
fail_compilation/test21025.d(15): Error: variable `r` cannot be read at compile time |
| 8 |
fail_compilation/test21025.d(15): called from here: `binaryFun(r, r)` |
| 9 |
fail_compilation/test21025.d(24): Error: template `uniq` is not callable using argument types `!()(void[])` |
| 10 |
fail_compilation/test21025.d(14): Candidate is: `uniq()(int[] r)` |
| 11 |
--- |
| 12 |
*/ |
| 13 |
|
| 14 |
void uniq()(int[] r) |
| 15 |
if (binaryFun(r, r)) {} |
| 16 |
|
| 17 |
bool binaryFun(T, U)(T, U) |
| 18 |
{ |
| 19 |
return true; |
| 20 |
} |
| 21 |
|
| 22 |
void generateStatements() |
| 23 |
{ |
| 24 |
uniq([]); |
| 25 |
} |