dmd/compiler/test/fail_compilation/ice14907.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

22 lines
814 B
D

/*
TEST_OUTPUT:
---
fail_compilation/ice14907.d(14): Error: struct `ice14907.S(int v = S)` recursive template expansion
fail_compilation/ice14907.d(19): while looking for match for `S!()`
fail_compilation/ice14907.d(15): Error: template `ice14907.f(int v = f)()` recursive template expansion
fail_compilation/ice14907.d(20): while looking for match for `f!()`
fail_compilation/ice14907.d(15): Error: template `ice14907.f(int v = f)()` recursive template expansion
fail_compilation/ice14907.d(21): Error: template `ice14907.f` is not callable using argument types `!()()`
fail_compilation/ice14907.d(15): Candidate is: `f(int v = f)()`
---
*/
struct S(int v = S) {}
void f(int v = f)() {}
void main()
{
S!() s; // OK <- ICE
f!()(); // OK <- ICE
f(); // OK <- ICE
}