develooper Front page | perl.cvs.parrot | Postings from December 2008

[svn:parrot] r33781 - trunk/languages/perl6/src/pmc

From:
jonathan
Date:
December 10, 2008 14:27
Subject:
[svn:parrot] r33781 - trunk/languages/perl6/src/pmc
Message ID:
20081210222640.A85E9CBA89@x12.develooper.com
Author: jonathan
Date: Wed Dec 10 14:26:39 2008
New Revision: 33781

Modified:
   trunk/languages/perl6/src/pmc/perl6multisub.pmc

Log:
[rakudo] Make Perl6MultiSub honor lack of multi_invocant in a signature, meaning ;; now functions correctly.

Modified: trunk/languages/perl6/src/pmc/perl6multisub.pmc
==============================================================================
--- trunk/languages/perl6/src/pmc/perl6multisub.pmc	(original)
+++ trunk/languages/perl6/src/pmc/perl6multisub.pmc	Wed Dec 10 14:26:39 2008
@@ -327,15 +327,18 @@
         info->types = mem_allocate_n_zeroed_typed(sig_elems + 1, PMC*);
         info->constraints = mem_allocate_n_zeroed_typed(sig_elems + 1, PMC*);
         for (j = 0; j < sig_elems; j++) {
-            PMC *param = VTABLE_get_pmc_keyed_int(interp, params, j);
-            PMC *type = VTABLE_get_pmc_keyed_str(interp, param,
+            PMC *param       = VTABLE_get_pmc_keyed_int(interp, params, j);
+            PMC *type        = VTABLE_get_pmc_keyed_str(interp, param,
                     CONST_STRING(interp, "type"));
             PMC *constraints = VTABLE_get_pmc_keyed_str(interp, param,
                     CONST_STRING(interp, "constraints"));
+            PMC *multi_inv   = VTABLE_get_pmc_keyed_str(interp, param,
+                    CONST_STRING(interp, "multi_invocant"));
             info->types[j] = type;
             info->constraints[j] = constraints;
+            if (!PMC_IS_NULL(multi_inv) && VTABLE_get_bool(interp, multi_inv))
+                info->num_types++;
         }
-        info->num_types = sig_elems;
 
         /* Add it to graph node, and initialize list of edges. */
         graph[insert_pos] = mem_allocate_zeroed_typed(candidate_graph_node);



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About