In perl6 I define a subroutine with two parameters, one a scalar and the other an array. When I call the subroutine I receive a run-time error saying that only one parameter was passed when two were expected.
I have tried redefining the subroutine with only one parameter, once for each parameter type, and these cases succeed.
my @bb="red", "orange", "yellow", "green", "bleu", "indigo", "violet";
sub1(@bb,123);
sub sub1(@val2, $v) {
print "\@val2 = @val2\n";
print "\$v = $v\n";
}
I expect the output to be: red orange yellow green blue indigo violet 123
The actual result is: Too few positionals passed; expected 2 arguments but got 1