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
Null PMC access when attempting to get at a method within a class using &Class::method syntax in Rakudo #1677
Comments
From @masak<masak> rakudo: class A {}; my $x = &A::nosuch |
From @jnthnOn Sat Apr 10 14:26:00 2010, masak wrote:
Now:
Yes but only if you marked the method "our". Otherwise it's not Given to moritz++ for testing; note Code as what you get is good to test 00:00 <@jnthn> TimToady: say &nosuch::sub.WHAT # what should this be? Thanks, Jonathan |
The RT System itself - Status changed from 'new' to 'open' |
@moritz - Status changed from 'open' to 'resolved' |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in t/spec/S12-methods/what.t commit b2c44b304761621c37f3a9b72f2b28461db3dbda [t/spec] tests for RT #74236, &Class::method access Inline Patchdiff --git a/t/spec/S12-methods/what.t b/t/spec/S12-methods/what.t
index d315964..b1a1056 100644
--- a/t/spec/S12-methods/what.t
+++ b/t/spec/S12-methods/what.t
@@ -95,6 +95,19 @@ ok 1.1 == 11/10, 'decimal == the equivalent rational';
is ~2.WHAT, 'Int()', 'assignment to Int.WHAT does nothing';
}
+{
+ class AccessMethods {
+ our method a { };
+ method b { };
+ }
+
+ ok &AccessMethods::a.defined, 'Can access "our" method with &class::method';
+ ok &AccessMethods::a ~~ Method, '... and got a Method back';
+ nok &AccessMethods::b.defined, '"has" methods are hidden';
+ lives_ok {&AccessMethods::c.defined and die "foo"}, 'non-existant method access livess (and returns undef)';
+
+}
+
done_testing;
# vim: ft=perl6 |
Migrated from rt.perl.org#74236 (status was 'resolved')
Searchable as RT74236$
The text was updated successfully, but these errors were encountered: