Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
X::Syntax::Signature::InvocantMarker
  • Loading branch information
moritz committed Feb 26, 2012
1 parent 4f0ed5c commit 9d39e88
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Perl6/Actions.pm
Expand Up @@ -2306,7 +2306,7 @@ class Perl6::Actions is HLL::Actions {
my $sep := @*seps[$param_idx];
if ~$sep eq ':' {
if $param_idx != 0 {
$/.CURSOR.panic("Can only use : in a signature after the first parameter");
$*W.throw($/, 'X::Syntax::Signature::InvocantMarker')
}
%info<is_invocant> := 1;
}
Expand Down
6 changes: 6 additions & 0 deletions src/core/Exceptions.pm
Expand Up @@ -286,6 +286,12 @@ my class X::Syntax::Regex::Adverb does X::Syntax {
method message() { "Adverb $.adverb not allowed on $.construct" }
}

my class X::Syntax::Signature::InvocantMarker does X::Syntax {
method message() {
"Can only use : as invocant marker in a signature after the first parameter"
}
}

my class X::Attribute::Package does X::Comp {
has $.package-type;
method message() { "A $.package-type cannot have attributes" }
Expand Down

0 comments on commit 9d39e88

Please sign in to comment.