Skip to content

Commit

Permalink
Merge pull request #2291 from taboege/callframe-code-name-in-non-dwim…
Browse files Browse the repository at this point in the history
…my-hyperop-message

Check for definedness of callframe.code when creating error message
  • Loading branch information
zoffixznet committed Sep 19, 2018
2 parents 19edeaf + f359fa9 commit e889d7e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/metaops.pm6
Expand Up @@ -566,7 +566,7 @@ multi sub HYPER(&operator, Positional:D \left, \right, :$dwim-left, :$dwim-right
my @result;
X::HyperOp::Infinite.new(:side<left>, :&operator).throw if left.is-lazy;
my int $elems = left.elems;
X::HyperOp::NonDWIM.new(:&operator, :left-elems($elems), :right-elems(1), :recursing(callframe(2).code.name eq 'HYPER')).throw
X::HyperOp::NonDWIM.new(:&operator, :left-elems($elems), :right-elems(1), :recursing(?(callframe(2).code andthen .name eq 'HYPER'))).throw
unless $elems == 1 or $elems > 1 and $dwim-right or $elems == 0 and $dwim-left || $dwim-right;
my \lefti := left.iterator;
my int $i = 0;
Expand All @@ -582,7 +582,7 @@ multi sub HYPER(&operator, \left, Positional:D \right, :$dwim-left, :$dwim-right
my @result;
X::HyperOp::Infinite.new(:side<right>, :&operator).throw if right.is-lazy;
my int $elems = right.elems;
X::HyperOp::NonDWIM.new(:&operator, :left-elems(1), :right-elems($elems), :recursing(callframe(3).code.name eq 'HYPER')).throw
X::HyperOp::NonDWIM.new(:&operator, :left-elems(1), :right-elems($elems), :recursing(?(callframe(3).code andthen .name eq 'HYPER'))).throw
unless $elems == 1 or $elems > 1 and $dwim-left or $elems == 0 and $dwim-left || $dwim-right;
my \righti := right.iterator;
my int $i = 0;
Expand Down Expand Up @@ -614,7 +614,7 @@ multi sub HYPER(&operator, Iterable:D \left, Iterable:D \right, :$dwim-left, :$d
my \leftv := lefti.pull-one;
my \rightv := righti.pull-one;

X::HyperOp::NonDWIM.new(:&operator, :left-elems(lefti.count-elems), :right-elems(righti.count-elems), :recursing(callframe(3).code.name eq 'HYPER')).throw
X::HyperOp::NonDWIM.new(:&operator, :left-elems(lefti.count-elems), :right-elems(righti.count-elems), :recursing(?(callframe(3).code andthen .name eq 'HYPER'))).throw
if !$dwim-left and !$dwim-right and (lefti.ended != righti.ended);

last if ($dwim-left and $dwim-right) ?? (lefti.ended and righti.ended) !!
Expand Down

0 comments on commit e889d7e

Please sign in to comment.