Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Support named parameters of .new method of imported P5 classes.
use Foo:from<Perl5>;
Foo.new(foo => 'custom');
  • Loading branch information
niner committed Jul 6, 2015
1 parent c8e0bc5 commit 78008b5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Inline/Perl5.pm6
Expand Up @@ -641,7 +641,7 @@ role Perl5Package[Inline::Perl5 $p5, Str $module] {
return $self;
}
else {
return $p5.invoke($module, 'new', @args.list);
return $p5.invoke($module, 'new', @args.list, %args.hash);
}
}

Expand Down
3 changes: 3 additions & 0 deletions t/from.t
Expand Up @@ -11,6 +11,9 @@ eval-dies-ok "use P5ModuleVersion:from<Perl5>:ver<2.1>;";

is(P5Import::ok(1), 1);

use Foo:from<Perl5>;
is(Foo.new(foo => 'custom').foo, 'custom');

done;

# vim: ft=perl6

0 comments on commit 78008b5

Please sign in to comment.