dmd/compiler/test/fail_compilation/fail95.d
Nick Treleaven 269ad2e9e4 Fix 'overloads' error when there are no overloads
Part of Issue 23897 - Bad diagnostic "none of the overloads of template"
for lamdba.
2023-05-08 13:41:57 +02:00

21 lines
416 B
D

/*
TEST_OUTPUT:
---
fail_compilation/fail95.d(19): Error: template `fail95.A` is not callable using argument types `!()(int)`
fail_compilation/fail95.d(11): Candidate is: `A(alias T)(T)`
---
*/
// https://issues.dlang.org/show_bug.cgi?id=142
// Assertion failure: '0' on line 610 in file 'template.c'
template A(alias T)
{
void A(T) { T = 2; }
}
void main()
{
int i;
A(i);
assert(i == 2);
}