dmd/compiler/test/fail_compilation/fail15616b.d
Nick Treleaven 130433a8e7
Fix Issue 23463 - Don't count skipped function overloads when limiting overloads shown (#14620)
* Fix Issue 23463 - Don't count skipped function overloads when limiting overloads shown

Also avoids repeating the skip checks for fd.

* Merge displayed and printed variables

* test for deprecated overload that shouldn't count as skipped

* This also fixes spurious 'all candidates marked deprecated/@disable' in verbose mode
2022-11-06 07:28:28 +08:00

58 lines
1.7 KiB
D

/*
REQUIRED_ARGS: -v
TRANSFORM_OUTPUT: remove_lines("^(predefs|binary|version|config|DFLAG|parse|import|semantic|entry|\s*$)")
TEST_OUTPUT:
---
fail_compilation/fail15616b.d(44): Error: none of the overloads of `foo` are callable using argument types `(double)`
fail_compilation/fail15616b.d(17): Candidates are: `fail15616b.foo(int a)`
fail_compilation/fail15616b.d(20): `fail15616b.foo(int a, int b)`
fail_compilation/fail15616b.d(29): `fail15616b.foo(int a, int b, int c)`
fail_compilation/fail15616b.d(32): `fail15616b.foo(string a)`
fail_compilation/fail15616b.d(35): `fail15616b.foo(string a, string b)`
fail_compilation/fail15616b.d(38): `fail15616b.foo(string a, string b, string c)`
fail_compilation/fail15616b.d(23): `foo(T)(T a)`
with `T = double`
whose parameters have the following constraints:
`~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
` > is(T == float)
` `~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
fail_compilation/fail15616b.d(26): `foo(T)(T a)`
with `T = double`
whose parameters have the following constraints:
`~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
` > is(T == char)
` `~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
Tip: not satisfied constraints are marked with `>`
---
*/
#line 17
void foo(int a)
{}
void foo(int a, int b)
{}
void foo(T)(T a) if (is(T == float))
{}
void foo(T)(T a) if (is(T == char))
{}
void foo(int a, int b, int c)
{}
void foo(string a)
{}
void foo(string a, string b)
{}
void foo(string a, string b, string c)
{}
void main()
{
foo(3.14);
}