On Sun Sep 18 17:09:21 2016, [email protected] wrote:
> Code:
> sub foo(@array ($first, @rest)) { say @rest };
> foo <1 2 3>
>
> Result:
> cannot stringify this
> in sub foo at -e line 1
> in block <unit> at -e line 2
>
> “cannot stringify this” error message is coming from MoarVM. This should not
> happen, right?
>
> Anyway, it is definitely LTA and could be improved.
Yeah, was a badass umption in the signature binder's error handling code. Fixed
and now it more helpfully reports:
$ ./perl6-m -e 'sub foo(@array ($first, @rest)) { say @rest }; foo <1 2
3>;'Type check failed in binding to @rest; expected Positional but got IntStr
(IntStr.new(2, "2"))
in sub foo at -e line 1
in block <unit> at -e line 1
Added a test in S32-exceptions/misc.t.