Author: mdiep
Date: Sun Jun 17 16:34:16 2007
New Revision: 19073
Modified:
trunk/src/inter_call.c
trunk/t/op/calling.t
Log:
Fix #43231: [BUG] :slurpy :named after :optional fails
Modified: trunk/src/inter_call.c
==============================================================================
--- trunk/src/inter_call.c (original)
+++ trunk/src/inter_call.c Sun Jun 17 16:34:16 2007
@@ -850,7 +850,22 @@
/* if the src arg is named, we're done here */
if (st->name)
+ {
+ /* but first, take care of any :optional arguments */
+ while (dest->sig & PARROT_ARG_OPTIONAL) {
+ null_val(st->dest.sig, st);
+ /* actually store the argument */
+ idx = st->dest.u.op.pc[st->dest.i];
+ assert(idx >= 0);
+ store_arg(st, idx);
+ /* check for :opt_flag */
+ check_for_opt_flag(st, 0);
+ /* next dest arg */
+ dest->i++;
+ next_arg_sig(dest);
+ }
break;
+ }
/* if the dest is a named argument, we need to fill it as a positional
* since no named arguments have been given. so skip the name. */
Modified: trunk/t/op/calling.t
==============================================================================
--- trunk/t/op/calling.t (original)
+++ trunk/t/op/calling.t Sun Jun 17 16:34:16 2007
@@ -2448,7 +2448,7 @@
OUTPUT
-pir_output_is( <<'CODE', <<'OUTPUT', "slurpy named after :optional",
'todo'=>'RT #43231' );
+pir_output_is( <<'CODE', <<'OUTPUT', "slurpy named after :optional" );
.sub main :main
foo(0, 'abc' => 1)
foo('abc' => 2)