1 // More nuanced test cases for invalid arguments #65853
6 fn two_arg_same(_a: i32, _b: i32) {}
7 fn two_arg_diff(_a: i32, _b: f32) {}
8 fn three_arg_diff(_a: i32, _b: f32, _c: &str) {}
9 fn three_arg_repeat(_a: i32, _b: i32, _c: &str) {}
12 // Providing an incorrect argument for a single parameter function
13 one_arg(1.0); //~ ERROR mismatched types
15 // Providing one or two invalid arguments to a two parameter function
16 two_arg_same(1, ""); //~ ERROR mismatched types
17 two_arg_same("", 1); //~ ERROR mismatched types
18 two_arg_same("", ""); //~ ERROR arguments to this function are incorrect
19 two_arg_diff(1, ""); //~ ERROR mismatched types
20 two_arg_diff("", 1.0); //~ ERROR mismatched types
21 two_arg_diff("", ""); //~ ERROR arguments to this function are incorrect
23 // Providing invalid arguments to a three parameter function
24 three_arg_diff(X{}, 1.0, ""); //~ ERROR mismatched types
25 three_arg_diff(1, X {}, ""); //~ ERROR mismatched types
26 three_arg_diff(1, 1.0, X {}); //~ ERROR mismatched types
28 three_arg_diff(X {}, X {}, ""); //~ ERROR arguments to this function are incorrect
29 three_arg_diff(X {}, 1.0, X {}); //~ ERROR arguments to this function are incorrect
30 three_arg_diff(1, X {}, X {}); //~ ERROR arguments to this function are incorrect
32 three_arg_diff(X {}, X {}, X {}); //~ ERROR arguments to this function are incorrect
34 three_arg_repeat(X {}, 1, ""); //~ ERROR mismatched types
35 three_arg_repeat(1, X {}, ""); //~ ERROR mismatched types
36 three_arg_repeat(1, 1, X {}); //~ ERROR mismatched types
38 three_arg_repeat(X {}, X {}, ""); //~ ERROR arguments to this function are incorrect
39 three_arg_repeat(X {}, 1, X {}); //~ ERROR arguments to this function are incorrect
40 three_arg_repeat(1, X {}, X{}); //~ ERROR arguments to this function are incorrect
42 three_arg_repeat(X {}, X {}, X {}); //~ ERROR arguments to this function are incorrect