Private Methods in Roles

2017-07-03 Thread Martin Barth
Hi there, Assuming those two files A.pm and B.pm. The file A.pm contains a class A and a role R with a private-method and a $!private member. (the files are in the end of the e-mail) 1) I am wondering why a role can all its private methods: > perl6 -I. -e 'use A; use B; my $b = B.new; $b.pu

[perl #120919] [BUG] Private methods in roles don't bind 'self' correctly in Rakudo

2015-11-21 Thread Christian Bartolomaeus via RT
The test in S14-roles/basic.t passes now on JVM. Also the code from lizmat++ does not die: $ perl6 -e 'role R { method !m(@a) { say "ok: @a[]" }; method x() { self!m((my %).values) } }; class C does R { }; C.x' ok: I haven't yet looked at src/core/IO/Local.pm or src/core/Temporal.pm

[perl #120919] [BUG] Private methods in roles don't bind 'self' correctly in Rakudo

2014-10-17 Thread Christian Bartolomaeus via RT
This works on Moar but fails on Parrot and JVM: $ perl6-m -e 'role A { method pub { self!priv }; method !priv () { say "OH HAI" } }; class C does A { }; C.new.pub;' OH HAI $ perl6-p -e 'role A { method pub { self!priv }; method !priv () { say "OH HAI" } }; class C does A { }; C.new.pub;' Cannot

[perl #120919] [BUG] Private methods in roles don't bind 'self' correctly in Rakudo

2014-01-02 Thread Carl Mäsak
s: looks like 'self' isn't parameterized correctly in private methods in roles. r: class A { method pub { self!priv }; method !priv { say "OH HAI" } }; A.new.pub rakudo-parrot a77214, rakudo-jvm a77214: OUTPUT«OH HAI␤» skids: do you know if that's already submitted? masak

Private methods in Roles (Was: Re: YAPC::EU and Perl 6 Roles)

2009-07-08 Thread Daniel Ruoso
Em Qua, 2009-07-08 às 12:49 -0700, Ovid escreveu: > Behavioral: if you are primarily relying on roles to provide behavior > (as we do at the BBC), then silently discarding the role's behavior by > providing a method of the same name in your class can lead to very > confusing bugs. I've lost a lot