From c60405b224407aa98f7176117c3aa04e3147dd85 Mon Sep 17 00:00:00 2001 From: Elizabeth Mattijsen Date: Fri, 14 Sep 2018 16:48:26 +0200 Subject: [PATCH] Add tests for R#2275 --- S06-signature/introspection.t | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/S06-signature/introspection.t b/S06-signature/introspection.t index 7fab03cc93..f27cac104d 100644 --- a/S06-signature/introspection.t +++ b/S06-signature/introspection.t @@ -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 @@ -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