Skip to content
Permalink
Browse files

Properly represent constant constraint on Parameter.perl

  • Loading branch information...
lizmat committed Mar 9, 2019
1 parent 4cfe5ec commit a1591fbe29333222d1c06cc1d047d78f9a4cb2d9
Showing with 11 additions and 0 deletions.
  1. +11 −0 src/core/Parameter.pm6
@@ -610,6 +610,17 @@ my class Parameter { # declared in BOOTSTRAP
$rest ~= ' ' ~ $sig;
}
unless nqp::isnull(@!post_constraints) {
# it's a Cool constant
if !$rest
&& $name eq '$'
&& nqp::elems(@!post_constraints) == 1
&& nqp::istype(
(my \value := nqp::atpos(@!post_constraints,0)),
Cool
) {
return value.perl;
}

$rest ~= ' where { ... }';
}
$rest ~= " = $!default_value.perl()" if $default;

0 comments on commit a1591fb

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