Author: jonathan
Date: Wed Dec 10 14:41:53 2008
New Revision: 33782
Modified:
trunk/languages/perl6/src/parser/actions.pm
Log:
[rakudo] Make it an error to use only, multi or proto with an anonymous routine.
Modified: trunk/languages/perl6/src/parser/actions.pm
==============================================================================
--- trunk/languages/perl6/src/parser/actions.pm (original)
+++ trunk/languages/perl6/src/parser/actions.pm Wed Dec 10 14:41:53 2008
@@ -479,6 +479,11 @@
create_sub($/, $past);
}
+ # If we have an only, proto or multi, we must have a name.
+ if $<sym> ne "" && $past.name() eq "" {
+ $/.panic("'" ~ $<sym> ~ "' can only be used on named routines");
+ }
+
# If it was multi or a proto, then emit a :multi.
if $<sym> eq 'multi' || $<sym> eq 'proto' {
# For now, if this is a multi we need to add code to transform the
sub's