Skip to content

Commit

Permalink
Add tests for R#2275
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Sep 14, 2018
1 parent 7e30619 commit c60405b
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion S06-signature/introspection.t
Expand Up @@ -5,7 +5,8 @@ use lib $?FILE.IO.parent(2).add("packages");
use Test;
use Test::Util;
use Test::Idempotence;
plan 133;

plan 136;

# L<S06/Signature Introspection>

Expand Down Expand Up @@ -256,4 +257,21 @@ is $rolesig, ':($a, $b, ::?CLASS $c)', ".perl of a sigature that has ::?CLASS";
is-deeply sub ($,$,$,$){}.signature.gist, '($, $, $, $)',
'.gist does not strip typeless anon sigils';

# R#2275
{
is :(:$*a).params[0].twigil, "*",
'does a dynamic Parameter have a * twigil';

class B {
has $!a;
has $.b;
method foo($!a) { }
method bar($.a) { }
}
is B.^find_method("foo").signature.params[1].twigil, "!",
'does a private attribute Parameter have a ! twigil';
is B.^find_method("bar").signature.params[1].twigil, ".",
'does a public attribute Parameter have a . twigil';
}

# vim: ft=perl6

0 comments on commit c60405b

Please sign in to comment.