diff --git a/src/Perl6/Actions.pm b/src/Perl6/Actions.pm index 6e3b1b8f895..646413a8877 100644 --- a/src/Perl6/Actions.pm +++ b/src/Perl6/Actions.pm @@ -2779,11 +2779,11 @@ class Perl6::Actions is HLL::Actions { $past.push(PAST::Var.new(:named, :scope, :name)); } if $key eq 'PREFIX' || $key eq 'INFIX' || $key eq 'POSTFIX' { - $past := whatever_curry($/, $past, $key eq 'INFIX' ?? 2 !! 1); - } - if $return_map { - $past := PAST::Op.new($past, - :pirop('perl6ize_type PP'), :returns($past.returns())); + $past := whatever_curry($/, (my $orig := $past), $key eq 'INFIX' ?? 2 !! 1); + if $return_map && $orig =:= $past { + $past := PAST::Op.new($past, + :pirop('perl6ize_type PP'), :returns($past.returns())); + } } make $past; }