Skip to content
Permalink
Browse files

Remove :where support for Signature/Parameter.perl

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 4cfe5ec1056a82387654f540ab68d47c358fa076
Showing with 4 additions and 7 deletions.
  1. +2 −2 src/core/Parameter.pm6
  2. +2 −5 src/core/Signature.pm6
@@ -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;
@@ -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 {
@@ -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 ?? ':(' !! '(';

@@ -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;

0 comments on commit 4cfe5ec

Please sign in to comment.
You can’t perform that action at this time.