Skip to content

Commit

Permalink
Remove :where support for Signature/Parameter.perl
Browse files Browse the repository at this point in the history
The "where" parameter was only used on the internal !gistperl method, but
that was never called with a "where" parameter.  So remove this complication
all the way up
  • Loading branch information
lizmat committed Mar 9, 2019
1 parent 99ba0ea commit 4cfe5ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/core/Parameter.pm6
Expand Up @@ -535,7 +535,7 @@ my class Parameter { # declared in BOOTSTRAP
True;
}

multi method perl(Parameter:D: Mu:U :$elide-type = Any, :&where) {
multi method perl(Parameter:D: Mu:U :$elide-type = Any) {
my $perl = '';
my $rest = '';
my $type = $!nominal_type.^name;
Expand Down Expand Up @@ -610,7 +610,7 @@ my class Parameter { # declared in BOOTSTRAP
$rest ~= ' ' ~ $sig;
}
unless nqp::isnull(@!post_constraints) {
$rest ~= " $_" with &where ?? &where(self) !! 'where { ... }';
$rest ~= ' where { ... }';
}
$rest ~= " = $!default_value.perl()" if $default;
if $name or $rest {
Expand Down
7 changes: 2 additions & 5 deletions src/core/Signature.pm6
Expand Up @@ -107,8 +107,7 @@ my class Signature { # declared in BOOTSTRAP
nqp::clone(@!params));
}

method !gistperl(Signature:D: $perl, Mu:U :$elide-type = Mu,
:&where = -> $ { 'where { ... }' } ) {
method !gistperl(Signature:D: $perl, Mu:U :$elide-type = Mu) {
# Opening.
my $text = $perl ?? ':(' !! '(';

Expand All @@ -124,9 +123,7 @@ my class Signature { # declared in BOOTSTRAP

my $sep = '';
for @params.kv -> $i, $param {
my $parmstr = $param.perl(:$elide-type, :&where);
return Nil without $parmstr;
$text ~= $sep ~ $parmstr;
$text ~= $sep ~ $_ with $param.perl(:$elide-type);

# Remove sigils from anon typed scalars, leaving type only
$text .= subst(/» ' $'$/,'') unless $perl;
Expand Down

0 comments on commit 4cfe5ec

Please sign in to comment.