Skip to content

Commit

Permalink
Make Signature.new(arity => ) default to number of parameters
Browse files Browse the repository at this point in the history
Seems to be more sensible than 0
  • Loading branch information
lizmat committed Jan 11, 2019
1 parent ab8052d commit d6b1bd2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/Signature.pm6
Expand Up @@ -9,7 +9,10 @@ my class Signature { # declared in BOOTSTRAP
# has Code $!code; # has Code $!code;


multi method new(Signature:U: 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) nqp::create(self)!SET-SELF(@params, $returns, $arity, $count)
} }
Expand Down

0 comments on commit d6b1bd2

Please sign in to comment.