d: Merge upstream dmd, druntime 4c18eed967, phobos d945686a4.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / fail332.d
blob77e8cd8eb00e722366c03bfc006e5fd78d7c1b00
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/fail332.d(22): Error: function `fail332.foo(int __param_0, ...)` is not callable using argument types `()`
5 fail_compilation/fail332.d(22): missing argument for parameter #1: `int __param_0`
6 fail_compilation/fail332.d(23): Error: function `fail332.foo(int __param_0, ...)` is not callable using argument types `(typeof(null))`
7 fail_compilation/fail332.d(23): cannot pass argument `null` of type `typeof(null)` to parameter `int __param_0`
8 fail_compilation/fail332.d(25): Error: function `fail332.baz(int[] __param_0...)` is not callable using argument types `(string)`
9 fail_compilation/fail332.d(25): cannot pass argument `""` of type `string` to parameter `int[] __param_0...`
10 fail_compilation/fail332.d(26): Error: function `fail332.baz(int[] __param_0...)` is not callable using argument types `(int, typeof(null))`
11 fail_compilation/fail332.d(26): cannot pass argument `null` of type `typeof(null)` to parameter `int[] __param_0...`
12 ---
15 import core.vararg;
17 void foo(int, ...) {}
18 void baz(int[]...) {}
20 void test()
22 foo();
23 foo(null);
25 baz("");
26 baz(3, null);
30 TEST_OUTPUT:
31 ---
32 fail_compilation/fail332.d(50): Error: function `fail332.bar(Object, int[2]...)` is not callable using argument types `()`
33 fail_compilation/fail332.d(50): missing argument for parameter #1: `Object`
34 fail_compilation/fail332.d(51): Error: function `fail332.bar(Object, int[2]...)` is not callable using argument types `(int)`
35 fail_compilation/fail332.d(51): cannot pass argument `4` of type `int` to parameter `Object`
36 fail_compilation/fail332.d(52): Error: function `fail332.bar(Object, int[2]...)` is not callable using argument types `(typeof(null))`
37 fail_compilation/fail332.d(52): expected 2 variadic argument(s), not 0
38 fail_compilation/fail332.d(53): Error: function `fail332.bar(Object, int[2]...)` is not callable using argument types `(typeof(null), int)`
39 fail_compilation/fail332.d(53): expected 2 variadic argument(s), not 1
40 fail_compilation/fail332.d(54): Error: function `fail332.bar(Object, int[2]...)` is not callable using argument types `(typeof(null), int, string)`
41 fail_compilation/fail332.d(54): cannot pass argument `""` of type `string` to parameter `int[2]...`
42 fail_compilation/fail332.d(55): Error: function `fail332.bar(Object, int[2]...)` is not callable using argument types `(typeof(null), int, int, int)`
43 fail_compilation/fail332.d(55): expected 2 variadic argument(s), not 3
44 ---
46 void bar(Object, int[2]...);
48 void test2()
50 bar();
51 bar(4);
52 bar(null);
53 bar(null, 2);
54 bar(null, 2, "");
55 bar(null, 2,3,4);