| 1 |
/* |
| 2 |
TEST_OUTPUT: |
| 3 |
--- |
| 4 |
fail_compilation/diag8648.d(18): Error: undefined identifier `X` |
| 5 |
fail_compilation/diag8648.d(29): Error: template `foo` is not callable using argument types `!()(Foo!(int, 1))` |
| 6 |
fail_compilation/diag8648.d(18): Candidate is: `foo(T, n)(X!(T, n))` |
| 7 |
fail_compilation/diag8648.d(20): Error: undefined identifier `a` |
| 8 |
fail_compilation/diag8648.d(31): Error: template `bar` is not callable using argument types `!()(Foo!(int, 1))` |
| 9 |
fail_compilation/diag8648.d(20): Candidate is: `bar(T)(Foo!(T, a))` |
| 10 |
fail_compilation/diag8648.d(20): Error: undefined identifier `a` |
| 11 |
fail_compilation/diag8648.d(32): Error: template `bar` is not callable using argument types `!()(Foo!(int, f))` |
| 12 |
fail_compilation/diag8648.d(20): Candidate is: `bar(T)(Foo!(T, a))` |
| 13 |
--- |
| 14 |
*/ |
| 15 |
|
| 16 |
struct Foo(T, alias a) {} |
| 17 |
|
| 18 |
void foo(T, n)(X!(T, n) ) {} // undefined identifier 'X' |
| 19 |
|
| 20 |
void bar(T)(Foo!(T, a) ) {} // undefined identifier 'a' |
| 21 |
|
| 22 |
void main() |
| 23 |
{ |
| 24 |
template f() {} |
| 25 |
|
| 26 |
Foo!(int, 1) x; |
| 27 |
Foo!(int, f) y; |
| 28 |
|
| 29 |
foo(x); |
| 30 |
|
| 31 |
bar(x); // expression '1' vs undefined Type 'a' |
| 32 |
bar(y); // symbol 'f' vs undefined Type 'a' |
| 33 |
} |