Skip to content

Commit

Permalink
Only ignore last arg in a Method if '%_'
Browse files Browse the repository at this point in the history
Although technically currently all Methods have a *%_ added to
their signature, it *is* possible to create a Method artificially
that does not have that.  So we need to check for the name here,
as is being done in similar situations in NativeCall.
  • Loading branch information
lizmat committed May 5, 2024
1 parent bd42616 commit f25dcac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/NativeCall.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ my sub check_routine_sanity(Routine $routine) is export(:TEST) {
# Methods have two extra parameters: self and %_, ignore those
if nqp::istype($routine,Method) {
++$i; # ignore self
--$m; # ignore %_
--$m if nqp::atpos($params,$m - 1).name eq '%_';
}

while $i < $m {
Expand Down

0 comments on commit f25dcac

Please sign in to comment.