gcc/testsuite/gdc.test/fail_compilation/fail95.d
raw| 1 | /* |
| 2 | TEST_OUTPUT: |
| 3 | --- |
| 4 | fail_compilation/fail95.d(19): Error: template `A` is not callable using argument types `!()(int)` |
| 5 | fail_compilation/fail95.d(11): Candidate is: `A(alias T)(T)` |
| 6 | --- |
| 7 | */ |
| 8 | |
| 9 | // https://issues.dlang.org/show_bug.cgi?id=142 |
| 10 | // Assertion failure: '0' on line 610 in file 'template.c' |
| 11 | template A(alias T) |
| 12 | { |
| 13 | void A(T) { T = 2; } |
| 14 | } |
| 15 | |
| 16 | void main() |
| 17 | { |
| 18 | int i; |
| 19 | A(i); |
| 20 | assert(i == 2); |
| 21 | } |