Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make sure we pass keyword arguments to Perl 5
Fixes GH #40
  • Loading branch information
hoelzro committed Aug 26, 2015
1 parent 203cabc commit d3d9774
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/Inline/Perl5.pm6
Expand Up @@ -753,10 +753,10 @@ role Perl5Package[Inline::Perl5 $p5, Str $module] {
$!parent;
}

multi method FALLBACK($name, *@args) {
multi method FALLBACK($name, @args, %kwargs) {
return self.defined
?? $p5.invoke-parent($module, $!parent.ptr, False, $name, $!parent, |@args)
!! $p5.invoke($module, $name, |@args);
?? $p5.invoke-parent($module, $!parent.ptr, False, $name, $!parent, |@args, |%kwargs)
!! $p5.invoke($module, $name, |@args, |%kwargs);
}

for Any.^methods>>.name.list, <say> -> $name {
Expand Down Expand Up @@ -807,8 +807,8 @@ method require(Str $module, Num $version?) {

# install methods
for @$symbols -> $name {
my $method = my method (*@args) {
self.FALLBACK($name, @args.list);
my $method = my method (*@args, *%kwargs) {
self.FALLBACK($name, @args, %kwargs);
}
$method.set_name($name);
$class.^add_method($name, $method);
Expand Down

0 comments on commit d3d9774

Please sign in to comment.