metaop fix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ok 364 - RT #99942 | |
| ok 365 - reduce with X | |
| 1..2 | |
| ok 1 - '[leg] <a b c>' died | |
| ok 2 - right exception type (X::Syntax::CannotMeta) | |
| ok 366 - non-associative operator "[leg]" can not be used as reduction operator | |
| ok 367 - does [:a] parse ok and give the right value | |
| ok 368 - does [:a,] parse ok and give the right value | |
| ok 369 - does [:!a] parse ok and give the right value | |
| # Looks like you failed 7 tests of 369 | |
| $ perl6 --ll-exception -e 'say ([X~] <a b>, <a b>, <a b>);' | |
| aaa aab aba abb baa bab bba bbb | |
| $ git diff | |
| diff --git a/src/core/metaops.pm b/src/core/metaops.pm | |
| index 22d9c5a..7916ed6 100644 | |
| --- a/src/core/metaops.pm | |
| +++ b/src/core/metaops.pm | |
| @@ -51,7 +51,7 @@ sub METAOP_CROSS(\op, &reduce) { | |
| my Mu $o := nqp::atpos($sublist, $j); | |
| @v[$i] := $o; | |
| $j = $j + 1; | |
| - if $i >= $n { take $rop(|@v); } | |
| + if $i >= $n { take lol.elems == 2 ?? $rop(|@v) !! $rop(@v); } | |
| else { $i = $i + 1; @j.push($j); $j = 0; } | |
| } | |
| elsif (my \value = @loi[$i].pull-one) !=:= IterationEnd { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment