New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Private methods in roles don't bind 'self' correctly in Rakudo #3304
Comments
From @masak<skids> r: role A { method pub { self!priv }; method !priv () { |
From @usev6This 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;' $ perl6-p -e 'role A { method pub { self!priv }; method !priv () { say "OH HAI" } }; class C does A { }; C.new.pub;' $ perl6-j -e 'role A { method pub { self!priv }; method !priv () { say "OH HAI" } }; class C does A { }; C.new.pub;' I added a test (skipped for Parrot and JVM) to S14-roles/basic.t with the following commit: Raku/roast@8942c27ab2 |
1 similar comment
From @usev6This 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;' $ perl6-p -e 'role A { method pub { self!priv }; method !priv () { say "OH HAI" } }; class C does A { }; C.new.pub;' $ perl6-j -e 'role A { method pub { self!priv }; method !priv () { say "OH HAI" } }; class C does A { }; C.new.pub;' I added a test (skipped for Parrot and JVM) to S14-roles/basic.t with the following commit: Raku/roast@8942c27ab2 |
@usev6 - Status changed from 'new' to 'open' |
From @lizmatOn 17 Oct 2014, at 14:45, Christian Bartolomaeus via RT <bugs-comment@bugs6.perl.org> wrote:
Related: $ 6 'role R { method !m(@a) { say "ok: @a[]" }; method x() { self!m((my %).values) } }; class C does R { }; C.x' This only seems to happen when passing something like .values of a hash. |
From @skidsThis is a reminder that, when this bug is fixed, there are In the former look for commented out lines accessig self! things In the latter, make the VALID-UNIT method private and adjust |
From @usev6The 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' I haven't yet looked at src/core/IO/Local.pm or src/core/Temporal.pm |
1 similar comment
From @usev6The 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' I haven't yet looked at src/core/IO/Local.pm or src/core/Temporal.pm |
@diakopter - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#120919 (status was 'resolved')
Searchable as RT120919$
The text was updated successfully, but these errors were encountered: