diff --git a/S06-signature/arity.t b/S06-signature/arity.t index 6f8fd9c727..ace48963dd 100644 --- a/S06-signature/arity.t +++ b/S06-signature/arity.t @@ -2,7 +2,7 @@ use v6; use Test; -plan 52; +plan 54; # L sub a_zero () { }; @@ -138,4 +138,12 @@ dies-ok { EVAL("a_zero( 'hello', 'world' )") }, 'no matching sub signature'; is (-> *@a { }).count, Inf, 'slurpy positional causes infinite count'; #OK not used is (-> *%a { }).count, 0, 'slurpy named causes no count change'; #OK not used +# RT #78240 +{ + sub a ($a, $b, $c) { 42 } + my &b = &a.assuming(1); + is &a.arity, 3, 'arity of original sub is 3'; + is &b.arity, 2, '.assuming(1) reduces arity by 1'; +} + # vim: ft=perl6