Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Teach compile time bind analysis about (|) sig.
It now recognizes such a signature as accepting anything, and thus
certain to be a successful match.
  • Loading branch information
jnthn committed Jan 2, 2013
1 parent 13e8052 commit 0f0bb50
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/binder/bind.c
Expand Up @@ -1053,6 +1053,15 @@ INTVAL Rakudo_binding_trial_bind(PARROT_INTERP, PMC *sig_pmc, PMC *capture) {
if (!smo_id)
setup_binder_statics(interp);

/* If there's a single capture parameter, then we're OK. (Worth
* handling especially as it's the common case for protos). */
if (num_params == 1) {
Rakudo_Parameter *param = (Rakudo_Parameter *)PMC_data(
VTABLE_get_pmc_keyed_int(interp, params, 0));
if (param->flags & SIG_ELEM_IS_CAPTURE)
return TRIAL_BIND_OK;
}

/* Walk through the signature and consider the parameters. */
num_pos_args = VTABLE_elements(interp, capture);
for (i = 0; i < num_params; i++) {
Expand Down

0 comments on commit 0f0bb50

Please sign in to comment.