Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
More likely to get a mismatch on named/unnamed
Than it is to get one on sub signature/no sub signature.  So let's
test the named part first.
  • Loading branch information
lizmat committed Mar 9, 2016
1 parent 3ac34a4 commit 693be1d
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/core/Parameter.pm
Expand Up @@ -196,19 +196,6 @@ my class Parameter { # declared in BOOTSTRAP
return False;
}

# we have sub sig and not the same
my $osub_signature := nqp::getattr(o,Parameter,'$!sub_signature');
if $!sub_signature {
return False
unless $osub_signature
&& $!sub_signature.ACCEPTS($osub_signature);
}

# no sub sig, but other has one
elsif $osub_signature {
return False;
}

# have nameds here
my $onamed_names := nqp::getattr(o,Parameter,'$!named_names');
if $!named_names {
Expand Down Expand Up @@ -241,6 +228,19 @@ my class Parameter { # declared in BOOTSTRAP
return False;
}

# we have sub sig and not the same
my $osub_signature := nqp::getattr(o,Parameter,'$!sub_signature');
if $!sub_signature {
return False
unless $osub_signature
&& $!sub_signature.ACCEPTS($osub_signature);
}

# no sub sig, but other has one
elsif $osub_signature {
return False;
}

# we have a post constraint
if nqp::islist($!post_constraints) {

Expand Down

0 comments on commit 693be1d

Please sign in to comment.