Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
:() sigs are more like block sigs than sub sigs
  • Loading branch information
lizmat committed Mar 4, 2016
1 parent 409ee89 commit 43d3db6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions S02-names-vars/signature.t
Expand Up @@ -37,23 +37,23 @@ plan 13;
ok(!$x.defined, "complex signature bindings works (2)");
}

# &sub.signature should return a Signature object
# block.signature should return a Signature object
{
sub foo1 ($a, $b) {} #OK not used
my $foo = -> $a, $b {} #OK not used
my $signature = :($a, $b);

ok ~$signature,
"a signature stringifies";
ok $signature eqv &foo1.signature,
ok $signature eqv $foo.signature,
"a subroutine's signature can be accessed via .signature (1)";
}

# Same as above, but more complex
{
my sub foo (Num $a, $b?, *@rest) {} #OK not used
my $foo = -> Num $a, $b?, *@rest {} #OK not used
my $signature = :(Num $a, $b?, *@rest);

ok $signature eqv &foo.signature ,
ok $signature eqv $foo.signature ,
"a subroutine's signature can be accessed via .signature (2)";
}

Expand Down

0 comments on commit 43d3db6

Please sign in to comment.