# New Ticket Created by  Stephane Payrard 
# Please include the string:  [perl #75588]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=75588 >


Apparently sending to bitbucket  is equivalent to >/dev/null

---------- Forwarded message ----------
From: Stéphane Payrard <[email protected]>
Date: Fri, Jun 4, 2010 at 1:50 PM
Subject: [rakudo] patch for better message when wrong syntax used for
named parameter
To: [email protected]


bash-3.2$ perl6
> sub b($:a) {...}
In signature parameter, placeholder variables like $:a are illegal
you probably meant a named parameter: ':$a' at line 1, near ") {...}\n"
>
bash-3.2$ git diff src/Perl6/Actions.pm
diff --git a/src/Perl6/Actions.pm b/src/Perl6/Actions.pm
index c5bbf63..6e892a4 100644
--- a/src/Perl6/Actions.pm
+++ b/src/Perl6/Actions.pm
@@ -1561,7 +1561,12 @@ method param_var($/) {
            }
        }
        elsif $twigil ne '!' && $twigil ne '.' && $twigil ne '*' {
-            $/.CURSOR.panic("Illegal to use $twigil twigil in signature");
+            my $error := "In signature parameter, '" ~ ~$/ ~ "', it
is illegal to use '" ~ $twigil ~ "' twigil";
+            if $twigil eq ':' {
+                $error := "In signature parameter, placeholder
variables like " ~ ~$/ ~ " are illegal\n"
+                           ~ "you probably meant a named parameter:
':" ~ $<sigil> ~ ~$<name>[0] ~ "'";
+            }
+            $/.CURSOR.panic($error);
        }
    }
 }


--
cognominal stef



-- 
cognominal stef

Reply via email to