diff --git a/src/core/Any-iterable-methods.pm b/src/core/Any-iterable-methods.pm index 21b6c013569..6de8bdbd18a 100644 --- a/src/core/Any-iterable-methods.pm +++ b/src/core/Any-iterable-methods.pm @@ -1818,7 +1818,7 @@ Did you mean to add a stub (\{...\}) or did you mean to .classify?" $pulled ) } - multi method head(Any:D: Callable:D $w) { + multi method head(Any:D: WhateverCode:D $w) { Seq.new( Rakudo::Iterator.AllButLastNValues(self.iterator,-($w(0).Int)) ) @@ -1841,7 +1841,7 @@ Did you mean to add a stub (\{...\}) or did you mean to .classify?" multi method tail(Any:D: $n) { Seq.new( nqp::if( - nqp::istype($n,Callable) + nqp::istype($n,WhateverCode) && nqp::isgt_i((my $skip := -($n(0).Int)),0), nqp::stmts( (my $iterator := self.iterator).skip-at-least($skip),