| 1 |
// EXTRA_SOURCES: imports/fail2962a.d |
| 2 |
|
| 3 |
// comment 6 |
| 4 |
/* |
| 5 |
TEST_OUTPUT: |
| 6 |
--- |
| 7 |
fail_compilation/fail2962.d(14): Error: variable `y` cannot be read at compile time |
| 8 |
fail_compilation/fail2962.d(14): while looking for match for `baz6!(int, y)` |
| 9 |
fail_compilation/fail2962.d(22): Error: template instance `fail2962.bar6!int` error instantiating |
| 10 |
--- |
| 11 |
*/ |
| 12 |
T bar6(T)(T y) |
| 13 |
{ |
| 14 |
return baz6!(T, y)(); |
| 15 |
} |
| 16 |
T baz6(T, T z)() |
| 17 |
{ |
| 18 |
return z * z; |
| 19 |
} |
| 20 |
void test6() |
| 21 |
{ |
| 22 |
assert(bar6(4) != 0); |
| 23 |
} |
| 24 |
|
| 25 |
// comment 4 |
| 26 |
/* |
| 27 |
TEST_OUTPUT: |
| 28 |
--- |
| 29 |
fail_compilation/fail2962.d(36): Error: variable `x` cannot be read at compile time |
| 30 |
fail_compilation/fail2962.d(36): while looking for match for `baz4!(int, x)` |
| 31 |
fail_compilation/imports/fail2962a.d(6): Error: template instance `fail2962.bar4!int` error instantiating |
| 32 |
--- |
| 33 |
*/ |
| 34 |
T bar4(T)(T x) |
| 35 |
{ |
| 36 |
return baz4!(T, x)(); |
| 37 |
} |
| 38 |
T baz4(T, T x)() |
| 39 |
{ |
| 40 |
return x; |
| 41 |
} |