Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'nom' of github.com:rakudo/rakudo into cpp
  • Loading branch information
FROGGS committed Mar 16, 2015
2 parents 43bf4fb + 67156c1 commit 8d11815
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
12 changes: 11 additions & 1 deletion lib/NativeCall.pm
Expand Up @@ -183,7 +183,17 @@ my role Native[Routine $r, Str $libname] {
$!setup = 1;
$!rettype := nqp::decont(map_return_type($r.returns));
}
nqp::nativecall($!rettype, self, nqp::getattr(nqp::decont(args), Capture, '$!list'))

my Mu $args := nqp::getattr(nqp::decont(args), Capture, '$!list');
if nqp::elems($args) != $r.signature.arity {
X::TypeCheck::Argument.new(
:objname($.name),
:arguments(nqp::p6list($args, Array, Mu).map(*.^name))
:signature(" Expected: " ~ try $r.signature.perl),
).throw
}

nqp::nativecall($!rettype, self, $args)
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/native_array.pm
Expand Up @@ -136,7 +136,7 @@ class array is Iterable is repr('VMArray') {
$!array := nqp::decont($array);
}

method reify($n, :$sink) {
method reify($n) { # :$sink is not needed here
unless nqp::isconcrete($!reified) {
my $rpa := nqp::list();
my int $i = $!idx;
Expand Down
2 changes: 1 addition & 1 deletion src/vm/jvm/runtime/org/perl6/rakudo/Binder.java
Expand Up @@ -398,7 +398,7 @@ else if (desiredNative == 0) {
if ((paramFlags & SIG_ELEM_DEFINED_ONLY) != 0 && Ops.isconcrete(arg_o, tc) != 1) {
if (error != null) {
if ((paramFlags & SIG_ELEM_INVOCANT) != 0) {
error[0] = "Invocant requires a instance, but a type object was passed";
error[0] = "Invocant requires an instance, but a type object was passed";
}
else {
error[0] = String.format(
Expand Down

0 comments on commit 8d11815

Please sign in to comment.