# New Ticket Created by  "p.malis...@gmail.com" 
# Please include the string:  [perl #70918]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=70918 >


Hello, rakudo...@perl.org.

Private methods are not as private as expected.
I'm using last rakudo snapshot (29.Nov.2009).

----------------- p6_private_test.pl ---------------------
#!/usr/bin/perl6

class PrivateDemo
{
        method !private($str)
        {
                return "PrivateDemo: $str";
        }
        method public
        {
                say self!private("test");
        }
}
my PrivateDemo $y .= new;

$y.public;
say $y!private('x'); # should not work!
--------------------------------------------------------------------

The output is:

$ ./p6_private_test.pl
PrivateDemo: test
PrivateDemo: x

But $y!private() should not even compile!

Bye, rakudo...@perl.org.

--
{ afunix 29 ноября 2009  }

Attachment: signature.asc
Description: PGP signature

Reply via email to