Skip to content

Commit

Permalink
Complain about declaration of placeholders in the mainline.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Oct 1, 2011
1 parent 5a38367 commit 464fb9f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Perl6/Actions.pm
Expand Up @@ -3551,8 +3551,14 @@ class Perl6::Actions is HLL::Actions {

# Adds a placeholder parameter to this block's signature.
sub add_placeholder_parameter($/, $sigil, $ident, :$named, :$pos_slurpy, :$named_slurpy) {
# Obtain/create placeholder parameter list.
# Ensure we're not trying to put a placeholder in the mainline.
my $block := $*ST.cur_lexpad();
if $block<IN_DECL> eq 'mainline' {
$/.CURSOR.panic("Cannot declare placeholder parameter $sigil" ~
($named ?? ':' !! '^') ~ "$ident in the mainline");
}

# Obtain/create placeholder parameter list.
my @params := $block<placeholder_sig> || ($block<placeholder_sig> := []);

# If we already declared this as a placeholder, we're done.
Expand Down

0 comments on commit 464fb9f

Please sign in to comment.