Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Return bare $-sigil for anonymous parameters.
Parameter.perl previously didn't return a $-sigil for
anonymous positional parameters without post-constraints.
This patch fixes that.
  • Loading branch information
peschwa committed Aug 17, 2014
1 parent 7752c57 commit 1c097d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/Parameter.pm
Expand Up @@ -173,7 +173,7 @@ my class Parameter { # declared in BOOTSTRAP
$perl ~= ':U';
}
$perl ~= " ::$_" for @($.type_captures);
my $name = $!variable_name || '';
my $name = $.name;
if $!flags +& $SIG_ELEM_IS_CAPTURE {
$name = '|' ~ $name;
} elsif $!flags +& $SIG_ELEM_IS_PARCEL {
Expand Down Expand Up @@ -214,7 +214,7 @@ my class Parameter { # declared in BOOTSTRAP
$sig ~~ s/^^ ':'//;
$rest ~= ' ' ~ $sig;
}
if $name ne '$' or $rest {
if $name or $rest {
$perl ~= ($perl ?? ' ' !! '') ~ $name;
$perl ~~ s/^^ \s* Mu \s+//;
}
Expand Down

0 comments on commit 1c097d4

Please sign in to comment.