Skip to content

Commit afae36a

Browse files
committed
.count and .arity on multis (RT #76646
1 parent 37d1b61 commit afae36a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

S06-signature/arity.t

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use v6;
22

33
use Test;
44

5-
plan 48;
5+
plan 50;
66

77
# L<S06/Required parameters/method:>
88
sub a_zero () { };
@@ -127,4 +127,12 @@ is &o_two.count, 1, 'count on sub with optional and required named params';
127127

128128
dies_ok { a_zero( 'hello', 'world' ) }, 'no matching sub signature';
129129

130+
{
131+
my proto sub a($, $?) { * }
132+
my multi sub a($) { 1 }
133+
my multi sub a($, $) { 2 }
134+
is &a.count, 2, '&multi.count';
135+
is &a.arity, 1, '&multi.arity';
136+
}
137+
130138
# vim: ft=perl6

0 commit comments

Comments
 (0)