]> git.ipfire.org Git - people/ms/gcc.git/blob - gcc/testsuite/gdc.test/fail_compilation/named_arguments_error.d
d: Merge upstream dmd, druntime 4ca4140e58, phobos 454dff14d.
[people/ms/gcc.git] / gcc / testsuite / gdc.test / fail_compilation / named_arguments_error.d
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/named_arguments_error.d(32): Error: function `named_arguments_error.f(int x, int y, int z)` is not callable using argument types `(int, int, int)`
5 fail_compilation/named_arguments_error.d(32): parameter `x` assigned twice
6 fail_compilation/named_arguments_error.d(33): Error: function `named_arguments_error.f(int x, int y, int z)` is not callable using argument types `(int, int, int)`
7 fail_compilation/named_arguments_error.d(33): argument `4` goes past end of parameter list
8 fail_compilation/named_arguments_error.d(34): Error: function `named_arguments_error.f(int x, int y, int z)` is not callable using argument types `(int, int, int)`
9 fail_compilation/named_arguments_error.d(34): parameter `y` assigned twice
10 fail_compilation/named_arguments_error.d(35): Error: function `named_arguments_error.f(int x, int y, int z)` is not callable using argument types `(int, int, int)`
11 fail_compilation/named_arguments_error.d(35): no parameter named `a`
12 fail_compilation/named_arguments_error.d(36): Error: function `named_arguments_error.g(int x, int y, int z = 3)` is not callable using argument types `(int, int)`
13 fail_compilation/named_arguments_error.d(36): missing argument for parameter #1: `int x`
14 fail_compilation/named_arguments_error.d(38): Error: no named argument `element` allowed for array dimension
15 fail_compilation/named_arguments_error.d(39): Error: no named argument `number` allowed for scalar
16 fail_compilation/named_arguments_error.d(40): Error: cannot implicitly convert expression `g(x: 3, y: 4, z: 5)` of type `int` to `string`
17 fail_compilation/named_arguments_error.d(41): Error: named arguments with Implicit Function Template Instantiation are not supported yet
18 fail_compilation/named_arguments_error.d(41): Error: none of the overloads of template `named_arguments_error.tempfun` are callable using argument types `!()(string, int)`
19 fail_compilation/named_arguments_error.d(45): Candidate is: `tempfun(T, U)(T t, U u)`
20 ---
21 */
22
23
24
25
26 void f(int x, int y, int z);
27
28 int g(int x, int y, int z = 3);
29
30 void main()
31 {
32 f(x: 3, x: 3, 5);
33 f(z: 3, 4, 5);
34 f(y: 3, x: 4, 5);
35 f(a: 3, b: 4, 5);
36 g(y: 4, z: 3);
37
38 auto g0 = new int[](element: 3);
39 auto g1 = new int(number: 3);
40 string s = g(x: 3, y: 4, z: 5);
41 enum x = tempfun(u: "u", t: 0);
42 }
43
44 // template arguments
45 int tempfun(T, U)(T t, U u)
46 {
47 return 3;
48 }