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
Cannot access lexical variable declared in role from method called in class doing that role in Rakudo #1371
Comments
From @masak<masak> rakudo: role A { my $foo = "OH HAI"; method bar() { say $foo } |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in t/spec/S14-roles/composition.t commit 8282341ffa5af1abb35a31d470184058a98c5009 [t/spec] Test for RT #69919 Inline Patchdiff --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 |
The RT System itself - Status changed from 'new' to 'open' |
From @moritzWorks now, and tests are passing. |
@moritz - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#69919 (status was 'resolved')
Searchable as RT69919$
The text was updated successfully, but these errors were encountered: