Skip to content
Permalink
Browse files

Make Signature.new(arity => ) default to number of parameters

Seems to be more sensible than 0
  • Loading branch information...
lizmat committed Jan 11, 2019
1 parent ab8052d commit d6b1bd2ae4ab7ea33a010fef8db68f988d551e80
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/core/Signature.pm6
@@ -9,7 +9,10 @@ my class Signature { # declared in BOOTSTRAP
# has Code $!code;

multi method new(Signature:U:
:@params, Mu :$returns, Int:D :$arity = 0, Num:D :$count = $arity.Num
:@params,
Mu :$returns,
Int:D :$arity = @params.elems,
Num:D :$count = $arity.Num
) {
nqp::create(self)!SET-SELF(@params, $returns, $arity, $count)
}

0 comments on commit d6b1bd2

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