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 ---
13 */
14 
15 import core.vararg;
16 
foo(int,...)17 void foo(int, ...) {}
baz(int[]...)18 void baz(int[]...) {}
19 
test()20 void test()
21 {
22     foo();
23     foo(null);
24 
25     baz("");
26     baz(3, null);
27 }
28 
29 /*
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 ---
45 */
46 void bar(Object, int[2]...);
47 
test2()48 void test2()
49 {
50     bar();
51     bar(4);
52     bar(null);
53     bar(null, 2);
54     bar(null, 2, "");
55     bar(null, 2,3,4);
56 }
57