Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Flatten return values from SEQUENCE
-- except when returning the empty list '()'

Fixes RT #80574 and makes 3 fudged tests in S03-sequence/misc.t pass
  • Loading branch information
usev6 committed Mar 16, 2015
1 parent 748e695 commit cd51b34
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/core/operators.pm
Expand Up @@ -198,7 +198,12 @@ sub SEQUENCE($left, Mu $right, :$exclude_end) {
last if $value ~~ $endpoint;
}
$tail.push($value);
take $value;
if $value {
take $value.flat
}
else { ## special case for returning ()
take $value;
}
}
}
elsif $badseq {
Expand Down

0 comments on commit cd51b34

Please sign in to comment.