Skip Menu |
Report information
Id: 69919
Status: resolved
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: masak <cmasak [at] gmail.com>
Cc:
AdminCc:

Severity: (no value)
Tag: Bug
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: [BUG] Cannot access lexical variable declared in role from method called in class doing that role in Rakudo
Date: Tue, 20 Oct 2009 16:53:59 +0200
To: rakudobug [...] perl.org
From: Carl Mäsak <cmasak [...] gmail.com>
Download (untitled) / with headers
text/plain 217b
<masak> rakudo: role A { my $foo = "OH HAI"; method bar() { say $foo } }; class B does A {}; B.new.bar <p6eval> rakudo 1ab069: OUTPUT«Null PMC access in type() [...] <masak> haha! * masak gleefully submits rakudobug
Subject: [perl #69919] tests available
Date: Wed, 21 Oct 2009 13:30:08 -0500
To: perl6-bugs-followup [...] perl.org
From: kyleha [...] gmail.com
Download (untitled) / with headers
text/plain 1.1k
This is an automatically generated mail to inform you that tests are now available in t/spec/S14-roles/composition.t commit 8282341ffa5af1abb35a31d470184058a98c5009 Author: kyle <kyle@c213334d-75ef-0310-aa23-eaa082d1ae64> Date: Wed Oct 21 18:29:00 2009 +0000 [t/spec] Test for RT #69919 git-svn-id: http://svn.pugscode.org/pugs@28872 c213334d-75ef-0310-aa23-eaa082d1ae64 diff --git a/t/spec/S14-roles/composition.t b/t/spec/S14-roles/composition.t index 57798e7..5d3c93f 100644 --- a/t/spec/S14-roles/composition.t +++ b/t/spec/S14-roles/composition.t @@ -1,6 +1,6 @@ use v6; use Test; -plan 19; +plan *; # L<S14/Roles/"Roles may be composed into a class at compile time"> @@ -85,4 +85,18 @@ ok rB !~~ RT64002, 'role not matched by second role it does'; is DE.new.foo, 'OH HAI', 'same with punning and inheritance'; } +# RT #69919 +{ + role RT69919 { + my $lex = 'Luthor'; + method rt69919 { return $lex } + } + class IL does RT69919 {} + + #?rakudo skip 'RT 69919, Null PMC access in type()' + is IL.new.rt69919, 'Luthor', 'access lexical declared in role from method called via class that does the role'; +} + +done_testing; + # vim: syn=perl6
Works now, and tests are passing.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org