mirror of
https://github.com/dlang/dmd.git
synced 2025-04-27 05:30:13 +03:00
Show nested template function signature in candidate message (#16827)
Part of Bugzilla 20713 - Improve Template Deduction Error Message Given Template Parameter Default Values
This commit is contained in:
parent
6a79518936
commit
855521dd86
2 changed files with 23 additions and 2 deletions
18
compiler/test/fail_compilation/nested_template_constraint.d
Normal file
18
compiler/test/fail_compilation/nested_template_constraint.d
Normal file
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
TEST_OUTPUT:
|
||||
---
|
||||
fail_compilation/nested_template_constraint.d(17): Error: template `foo` is not callable using argument types `!()(string, int)`
|
||||
fail_compilation/nested_template_constraint.d(10): Candidate is: `foo(int x = 0)`
|
||||
fail_compilation/nested_template_constraint.d(11): - Containing: `foo(T, U)(T t, U u)`
|
||||
---
|
||||
*/
|
||||
|
||||
template foo(int x = 0) {
|
||||
void foo(T, U)(T t, U u)
|
||||
if (is(T == int) && is(U == int)) {}
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
foo("hello", 4);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue