Skip to content

Commit

Permalink
1340fa6 changed Parameter.type to return the actual type, not its nam…
Browse files Browse the repository at this point in the history
…e -- now fix MAIN_HELPER's gen_usage() to compensate. Fixes #107244.
  • Loading branch information
Geoffrey Broadwell committed Jan 5, 2012
1 parent eccd5ee commit ae33c0b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/core/Main.pm
Expand Up @@ -116,8 +116,7 @@ my sub MAIN_HELPER($retval = 0) {
if $param.named {
my @names = $param.named_names.reverse;
$argument = @names.map({($^n.chars == 1 ?? '-' !! '--') ~ $^n}).join('|');
my $type = $param.type;
$argument ~= "=<$type>" unless $type ~~ 'Bool';
$argument ~= "=<{$param.type.^name}>" unless $param.type === Bool;
if $param.optional {
@optional-named.push("[$argument]");
}
Expand All @@ -130,7 +129,7 @@ my sub MAIN_HELPER($retval = 0) {
my $simple-const = $constraints && $constraints !~~ /^_block/;
$argument = $param.name ?? '<' ~ $param.name.substr(1) ~ '>' !!
$simple-const ?? $constraints !!
'<' ~ $param.type ~ '>' ;
'<' ~ $param.type.^name ~ '>' ;

$argument = "[$argument ...]" if $param.slurpy;
$argument = "[$argument]" if $param.optional;
Expand Down

0 comments on commit ae33c0b

Please sign in to comment.