Debian Codegraph @

gcc/testsuite/gdc.test/fail_compilation/fail15616b.d

raw
1 /*
2 REQUIRED_ARGS: -v
3 TRANSFORM_OUTPUT: remove_lines("^(predefs|binary|version|config|DFLAG|parse|import|semantic|entry|\s*$)")
4 TEST_OUTPUT:
5 ---
6 fail_compilation/fail15616b.d(44): Error: none of the overloads of `foo` are callable using argument types `(double)`
7 fail_compilation/fail15616b.d(17): Candidates are: `fail15616b.foo(int a)`
8 fail_compilation/fail15616b.d(20): `fail15616b.foo(int a, int b)`
9 fail_compilation/fail15616b.d(29): `fail15616b.foo(int a, int b, int c)`
10 fail_compilation/fail15616b.d(32): `fail15616b.foo(string a)`
11 fail_compilation/fail15616b.d(35): `fail15616b.foo(string a, string b)`
12 fail_compilation/fail15616b.d(38): `fail15616b.foo(string a, string b, string c)`
13 fail_compilation/fail15616b.d(23): `foo(T)(T a)`
14 with `T = double`
15 whose parameters have the following constraints:
16 `~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
17 ` > is(T == float)
18 ` `~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
19 fail_compilation/fail15616b.d(26): `foo(T)(T a)`
20 with `T = double`
21 whose parameters have the following constraints:
22 `~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
23 ` > is(T == char)
24 ` `~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
25 Tip: not satisfied constraints are marked with `>`
26 ---
27 */
28
29 #line 17
30 void foo(int a)
31 {}
32
33 void foo(int a, int b)
34 {}
35
36 void foo(T)(T a) if (is(T == float))
37 {}
38
39 void foo(T)(T a) if (is(T == char))
40 {}
41
42 void foo(int a, int b, int c)
43 {}
44
45 void foo(string a)
46 {}
47
48 void foo(string a, string b)
49 {}
50
51 void foo(string a, string b, string c)
52 {}
53
54
55 void main()
56 {
57 foo(3.14);
58 }