Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #41 from hoelzro/master
Fix GH #40
  • Loading branch information
niner committed Aug 26, 2015
2 parents 64826f1 + d3d9774 commit b0b56fc
Show file tree
Hide file tree
Showing 3 changed files with 29 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
12 changes: 12 additions & 0 deletions t/call_hash.t
@@ -0,0 +1,12 @@
use v6;

use Test;

use Inline::Perl5;

use lib:from<Perl5> <t/lib>;
use TakesHash:from<Perl5>;

is(TakesHash.give_hash(:foo<bar>), 'bar');

done;
12 changes: 12 additions & 0 deletions t/lib/TakesHash.pm
@@ -0,0 +1,12 @@
package TakesHash;

use strict;
use warnings;

sub give_hash {
my ($class, %args) = @_;

return $args{foo};
}

1;

0 comments on commit b0b56fc

Please sign in to comment.