Skip to content

Commit

Permalink
fix issue in binder/multidispatch.c where A is narrower than B is nar…
Browse files Browse the repository at this point in the history
…rower than A

Signed-off-by: Moritz Lenz <moritz@faui2k3.org>
  • Loading branch information
felher authored and moritz committed Aug 10, 2012
1 parent 4e14470 commit 8f97220
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/binder/multidispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,17 @@ static INTVAL is_narrower(PARROT_INTERP, Rakudo_md_candidate_info *a, Rakudo_md_
return 0;

/* Otherwise, we see if one has a slurpy and the other not. A lack of
* slurpiness makes the candidate narrower. Also narrower if the first
* needs a bind check and the second doesn't. Otherwise, they're tied. */
return (a->max_arity != SLURPY_ARITY && b->max_arity == SLURPY_ARITY) ||
(a->bind_check && !(b->bind_check));
* slurpiness makes the candidate narrower. */

if (a->max_arity != SLURPY_ARITY && b->max_arity == SLURPY_ARITY) {
return 1;
}

/* Also narrower if the first needs a bind check and the second doesn't, if
* we wouldn't deem the other one narrower than this one int terms of
* slurpyness. Otherwise, they're tied. */
return !(b->max_arity != SLURPY_ARITY && a->max_arity == SLURPY_ARITY)
&& (a->bind_check && !(b->bind_check));
}


Expand Down

0 comments on commit 8f97220

Please sign in to comment.