Skip to content

Commit

Permalink
Add test for RT #77744
Browse files Browse the repository at this point in the history
  • Loading branch information
usev6 committed Jul 8, 2015
1 parent 08b64b7 commit 1c8e5ab
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion S06-signature/arity.t
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 54;
plan 56;

# L<S06/Required parameters/method:>
sub a_zero () { };
Expand Down Expand Up @@ -146,4 +146,21 @@ is (-> *%a { }).count, 0, 'slurpy named causes no count change'; #OK not
is &b.arity, 2, '.assuming(1) reduces arity by 1';
}

# RT #77744
{
class A {
our method f ($x: $y) { $y * 2 }
}
my $a = A.new;
my &g = &A::f.assuming( $a );
is g(3), 6, 'correct number of required parameters for assuming-derived method (1)';

class B {
our method f ($x: $y, $z) { $y + $z }
}
my $b = B.new;
my &h = &B::f.assuming( $b );
is h(3, 11), 14, 'correct number of required parameters for assuming-derived method (1)';
}

# vim: ft=perl6

0 comments on commit 1c8e5ab

Please sign in to comment.