From 6c93fde85da027748bddd7cf75e295ed70ce3b05 Mon Sep 17 00:00:00 2001 From: Elizabeth Mattijsen Date: Mon, 17 Sep 2018 21:21:09 +0200 Subject: [PATCH] Make sure X handles empty lists on RHS Fixes R#2286 --- src/core/Rakudo/Iterator.pm6 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/core/Rakudo/Iterator.pm6 b/src/core/Rakudo/Iterator.pm6 index 27ca8ce7a2b..13a82b0dc12 100644 --- a/src/core/Rakudo/Iterator.pm6 +++ b/src/core/Rakudo/Iterator.pm6 @@ -1133,18 +1133,18 @@ class Rakudo::Iterator { # it's a List, may have a reified we can use directly nqp::if( - nqp::isnull( + nqp::isconcrete( $elem := nqp::getattr($elem,List,'$!reified') - ) || nqp::iseq_i(nqp::elems($elem),0), - - # cross with an empty list is always an empty list - (return Rakudo::Iterator.Empty), + ) && nqp::isgt_i(nqp::elems($elem),0), # use the available reified directly nqp::stmts( nqp::bindpos($!reifieds,$i,$elem), nqp::atpos($elem,0) - ) + ), + + # cross with an empty list is always an empty list + (return Rakudo::Iterator.Empty) ), # need to set up an iterator