Author: jonathan
Date: Tue Jan  6 13:40:38 2009
New Revision: 35080

Modified:
   branches/rvar/languages/perl6/src/parser/actions.pm

Log:
[rakudo] Restore check to make sure we can only multi/only/proto a named 
routine, as per S06.

Modified: branches/rvar/languages/perl6/src/parser/actions.pm
==============================================================================
--- branches/rvar/languages/perl6/src/parser/actions.pm (original)
+++ branches/rvar/languages/perl6/src/parser/actions.pm Tue Jan  6 13:40:38 2009
@@ -516,6 +516,11 @@
     my $past :=  $<declarator> ?? $( $<declarator> ) !! $( $<routine_def> );
 
     if $past.isa(PAST::Block) {
+        # If we have a multi declarator, must have a named routine too.
+        if $sym ne "" && $past.name() eq "" {
+            $/.panic("'" ~ $<sym> ~ "' can only be used on named routines");
+        }
+
         # If we're declaring a multi or a proto, flag the sub as :multi,
         # and transform the sub's container to a Perl6MultiSub.
         if $sym eq 'multi' || $sym eq 'proto' {

Reply via email to